在加载大量数据时,NestedScrollView中的RecyclerView需要花费太多时间

kun*_*l.c 5 android android-recyclerview android-nestedscrollview

NestedScrollView中的RecyclerView在加载大量数据时会冻结Activity.使用ScrollView加载速度要快得多,但在这种情况下滚动会受到影响.我尝试设置像setAutoMeasure和setNestedScrollingEnabled这样的属性没有帮助.有什么建议?

Sar*_*ern -2

你可以包括app:layout_behavior="@string/appbar_scrolling_view_behavior"

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)

或禁用回收器视图的嵌套滚动行为。

recyclerView.setNestedScrollingEnabled(false);
Run Code Online (Sandbox Code Playgroud)