首页 > 代码库 > ScrollView嵌套ListView显示不全的解决

ScrollView嵌套ListView显示不全的解决

简单自定义组件解决如上问题:

public class ExpandListView extends ListView {

    public ExpandListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * 设置不滚动
     */
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}




ScrollView嵌套ListView显示不全的解决