listview嵌套gridview时gridview不换行的问题解决方式

重写GridView的onMeasure()方法即可:

?
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
}
 

猜你喜欢

转载自lhc966.iteye.com/blog/1851446