<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
以上代码问题
1.LinearLayout设置的高失效
2.RecyclerView缓存失效
原因:
1. NestedScrollView覆写的measureChildWithMargins方法
@Override
protected void measureChildWithMargins(View child, int parentWi