ScrollView嵌套ListView滑动问题



@Override

    
/**
    

 * 重写该方法,达到使ListView适应ScrollView的效果


*/


protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {


        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);


super.onMeasure(widthMeasureSpec, expandSpec);


}


自定义ListView重写onMeasure方法


就是这么简单

猜你喜欢

转载自blog.csdn.net/try_zp_catch/article/details/80054220