1
我用两个RecyclerView
一个NestedScrollView
内。该设置很好,但我担心它可能具有的内存影响。我不确定RecylerView是否会像它那样回收组件。这有什么其他缺点吗?RecyclerView会回收NestedScrollView内的项目吗?
下面是一些代码:
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_coordinator_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="54dp"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout
android:id="@+id/toplayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleview1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleview2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/recycleview1"
android:nestedScrollingEnabled="false"/>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>