/**
* 解决listView中嵌套GridView只显示一行的情况
* @author Administrator
*
*/
public class GridViewForListView extends GridView {
public GridViewForListView(Context context) {
super(context);
}
public GridViewForListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
* 解决listView中嵌套GridView只显示一行的情况
* @author Administrator
*
*/
public class GridViewForListView extends GridView {
public GridViewForListView(Context context) {
super(context);
}
public GridViewForListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}