在Linearlayout中新增ScrollView支持滚动

https://blog.csdn.net/wenzhi20102321/article/details/53491176

 

1、一般只需要在布局中加个ScrollView即可

2、如果布局中包含listView或者gridView的话,需要重写listView或者gridView中的onMeasure方法

 

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

  

posted @ 2018-05-05 16:59  lelelong  阅读(2125)  评论(0编辑  收藏  举报