在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