【发布时间】:2016-09-10 19:15:28
【问题描述】:
我有一个 RecyclerView 作为底部视图,以及顶部的一些其他视图:
我想滚动整个视图 (1),而不仅仅是 RecyclerView (2)。
我已经设法让它工作了,但并非完美无缺。 XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar" />
<android.support.v4.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
...
<View
style="@style/Divider"
android:layout_marginBottom="16dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewNote"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
两个问题:
在 recyclerview 中滚动并不顺畅,因为当我抬起手指时,滚动停止。没有加速滚动,或者你怎么称呼它。
当我从回收站视图中删除项目时,它的高度保持不变。这意味着我在图像曾经存在的地方有空白空间。
【问题讨论】:
-
我也有同样的问题,我从服务器获取了recycler的数据,我已经检查过了,recycler不流畅的原因是它在一个滚动视图中并且一次从服务器获取所有图像和不可见的项目!我还没有任何解决方案,你有吗?!