在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);
    }

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM