Android Development: ScrollView nested GridView Solution
A few days ago in the development of the need to ScrollView nested gridview case, because these two controls are self-contained scroll bar, when they encounter together, there will be a problem, that is, the GridView will display incomplete.
Workaround, customize a GridView control
public class MyGridView extends GridView {Public MyGridView (context context, AttributeSet Attrs) {Super (context, attrs);}
Public MyGridView (Context context) {Super (context);}
Public MyGridView (context context, AttributeSet attrs, int defstyle) {Super (context, attrs, Defstyle); }  
@Override public void onmeasure (int WIDTHMEASURESPEC, INT HEIGHTMEASURESPEC) { 
int expandspec = measurespec.makemeasurespec ( integer.max_value >> 2, measurespec.at_most); super.onmeasure (WidthMeasureSpec,  EXPANDSPEC); } }
The custom control simply overrides the GridView Onmeasure method so that it does not appear in the scroll bar, ScrollView nested listview is the same reason, no longer repeat.
XML Layout Code
<scrollview android:layout_height= "Wrap_content"Android:layout_width= "Fill_parent" android:id= "@+id/scroll_content" ><com.yourclass.mygridview xmlns:android= "Http://schemas.android.com/apk/res/android"Android:id= "@+id/grid_view" android:layout_width= "Fill_parent"android:layout_height= "Wrap_content" android:numcolumns= "Auto_fit"android:horizontalspacing= "1dip" android:verticalspacing= "1dip" android:columnwidth= "15 0dip "android:stretchmode=" columnWidth " android:gravity=" center "> </ com.yourclass.mygridview> </ScrollView>
Java calling code
MyGridView gridview = (MyGridView) findViewById(R.id.grid_view); gridview.setAdapter(new ImageAdapter(this));
Android Development: ScrollView nested GridView Solution