public class HeightFixListView extends ListView { public HeightFixListView(Context context) { super(context); } public HeightFixListView(Context context, AttributeSet attrs) { super(context, attrs); } public HeightFixListView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int height = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, height); } //重写listview高度 }
listview和scrollview嵌套数据显示不全问题解决!
最新推荐文章于 2022-06-13 15:25:56 发布