I use a GridView in a ScrollView. As we all know,there must be some problems. So I use a Class extends GridView,and Override the onMeasure method with:
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
Thus the gridview problem can be resolved using Android 2.2 SDK. And the gridview can be focused Normally anyway.
My Question is : When I use Android 4.0 SDK, the problem is : I use that extended GridView in a ScrollView as well.The ScrollView is filling the parent. When the size of GridView is smaller than the existing ScrollView, the GridView can get the focus by touching it normally. However,when the number of child views of that GridView grows, and thus the ScrollView's size is getting larger.In other words,the ScrollView can be scrolled now. The GridView cannot get the focus anymore.
Can anyone help me resolve this tough problem? Thank you.