android NestedScrollView和ListView衝突問題

only_books發表於2024-04-25

listview顯示不全

需要重寫listview

public class MyListView extends ListView {

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

@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int mExpandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, mExpandSpec);
}
}

參考:https://blog.csdn.net/qq_35091074/article/details/122808771

相關文章