Android 循环视图上的加速滚动
我有一个回收视图,其中有一个CardsView列表。RecycleView位于NestedScrollView中,因为我有一个可折叠的标题滚动未加速,当我将手指从屏幕上拿开时,滚动停止,我希望加速滚动。 这些是我的布局Android 循环视图上的加速滚动,android,android-layout,android-studio,scrollbar,android-recyclerview,Android,Android Layout,Android Studio,Scrollbar,Android Recyclerview,我有一个回收视图,其中有一个CardsView列表。RecycleView位于NestedScrollView中,因为我有一个可折叠的标题滚动未加速,当我将手指从屏幕上拿开时,滚动停止,我希望加速滚动。 这些是我的布局 <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.andr
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".articles.ArticlesActivity"
tools:showIn="@layout/activity_articles"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/articles_lista"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true"
android:scrollbars="vertical"
/>
</android.support.v4.widget.NestedScrollView>
谢谢
编辑:
我的新布局正在运行,看起来像:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="newser.sab.com.newser.articles.ArticlesActivity2"
tools:showIn="@layout/app_bar_articles2">
<android.support.v7.widget.RecyclerView
android:id="@+id/articles_lista"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true"
android:scrollbars="vertical"
/>
</RelativeLayout>
正在更改布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="newser.sab.com.newser.articles.ArticlesActivity2"
tools:showIn="@layout/app_bar_articles2">
<android.support.v7.widget.RecyclerView
android:id="@+id/articles_lista"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true"
android:scrollbars="vertical"
/>
这是因为您在
滚动视图
中设置了回收视图
。
因此,要使其滚动更快,请在RecyclerView
标记中的xml文件中添加这一行
android:nestedScrollingEnabled="false"
或者在Java文件中动态添加这一行
recyclerView.setNestedScrollingEnabled(false);
我有完全相同的问题,有解决办法吗?
android:nestedScrollingEnabled="false"
recyclerView.setNestedScrollingEnabled(false);