NestedScrollView中的RecyclerView中的延迟加载视图

时间:2018-10-01 17:40:58

标签: android android-recyclerview android-nestedscrollview androidx

定位androidx 1.0.0以允许使用棒棒糖之前的设备(假设minSdkVersion 17左右)。

我尝试了视图,设置,滚动模式和布局管理器的许多组合。我已经阅读了所有内容-例如thisthisthis-关于此问题。要么我的布局/渲染性能不佳,要么滚动不正确/错误。

要求:

  1. 可从底部拖动底页。现代应用程序中常见的UI模式。
  2. 10-20 沉重大小相同的子视图。当它们不可见时,不得充气/绘制。
  3. 最好使用本机Android / Google视图。

我该如何实现?

这里有一些伪代码,显示了我要完成的工作; RecyclerView内带有NestedScrollView的{​​{1}}(或等效项):

BottomSheetBehavior

我了解到<ScrollView> <!-- Main content --> </ScrollView> <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:fillViewport="true" android:fitsSystemWindows="true" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" app:behavior_hideable="false" app:behavior_peekHeight="@dimen/bottom_sheet_peek_height"> <!-- RecyclerView? --> <TextView android:layout_width="match_parent" android:layout_height="@dimen/bottom_sheet_peek_height" android:text="Bottom sheet header" /> <-- N heavy equally sized child views here --> </androidx.core.widget.NestedScrollView> 的表现胜过RecyclerView。鉴于上述配置,它似乎从未回收其视图。

0 个答案:

没有答案
相关问题