gistfile1.txt //使用此类替换GridView 即可public class WrapHeightGridView extends GridView { public WrapHeightGridView(Context context) { this(context, (AttributeSet)null); } public WrapHeightGridView(Context context, AttributeSet at
//使用此类替换GridView 即可 public class WrapHeightGridView extends GridView { public WrapHeightGridView(Context context) { this(context, (AttributeSet)null); } public WrapHeightGridView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public WrapHeightGridView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int heightSpec = MeasureSpec.makeMeasureSpec(536870911, -2147483648); super.onMeasure(widthMeasureSpec, heightSpec); } }