ExpandableListView嵌套Gridview显示不全的问题

自定义GridView重写 onMeasure方法

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

MeasureSpec.AT_MOST:使用measureSpec中size的值作为最大值,采用不超过这个值的最大允许值

猜你喜欢

转载自blog.csdn.net/songmingzhan/article/details/77712647