我想在
我尝试了这个问题,但效果不好。RecyclerView中的内容可以从WS动态加载,是无限滚动的。当RecyclerView中的内容更新时,屏幕会冻结。 我从Twitter上看到了这个,我们该怎么做呢?https://drive.google.com/file/d/0B2JZggeoXKKFdG1ENmZEdWFIa0k/view?usp=sharing
尝试过但没有成功,RecyclerView内部的内容没有显示。
LinearLayout
上实现滚动,并禁用RecyclerView
的滚动。我尝试将LinearLayout
更改为NestedScrollView
,但它不起作用,我不知道为什么。我尝试了这个问题,但效果不好。RecyclerView中的内容可以从WS动态加载,是无限滚动的。当RecyclerView中的内容更新时,屏幕会冻结。 我从Twitter上看到了这个,我们该怎么做呢?https://drive.google.com/file/d/0B2JZggeoXKKFdG1ENmZEdWFIa0k/view?usp=sharing
例子
这是我的应用程序的简单屏幕,我想要滚动到红色
,但它目前滚动到了'蓝色'。非常感谢。
代码
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="16dp"
android:background="#CCC"
android:id="@+id/imageView2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Image caption"
android:background="#cbffa3"
android:padding="16dp"
android:id="@+id/textView8" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
尝试过但没有成功,RecyclerView内部的内容没有显示。
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="16dp"
android:background="#CCC"
android:id="@+id/imageView2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Image caption"
android:background="#cbffa3"
android:padding="16dp"
android:id="@+id/textView8" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>