重写 RecyclerView 的 onMeasure
@Override protected void onMeasure(int widthSpec, int heightSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthSpec, expandSpec); }
本文介绍了一种重写RecyclerView的onMeasure方法的方法,通过设置高度规格为最大值,使得RecyclerView能够更好地适应不同屏幕尺寸。
1043

被折叠的 条评论
为什么被折叠?



