Android 如何在scrollview中滚动RecyclerView
如何在scrollview中滚动所有上述RecyclerView 我必须在scrollview中实现RecyclerView,如下代码所示,但不能实现ScrollRecyclerView 请给出答案Android 如何在scrollview中滚动RecyclerView,android,xml,android-recyclerview,scrollview,Android,Xml,Android Recyclerview,Scrollview,如何在scrollview中滚动所有上述RecyclerView 我必须在scrollview中实现RecyclerView,如下代码所示,但不能实现ScrollRecyclerView 请给出答案 <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/horizontalScrollView"
android:layout_marginTop="10dp">
<RelativeLayout...
<android.support.v7.widget.RecyclerView
android:id="@+id/rvpouch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
android:layout_below="@+id/textView3">
</android.support.v7.widget.RecyclerView>
</RelativeLayout>
</ScrollView>
使用NestedScrollView而不是scroll view并设置
recyclerView.setNestedScrollingEnabled(false);
使用NestedScrollView而不是scroll view并设置
recyclerView.setNestedScrollingEnabled(false);
不要在ScrollView
内部使用RecyclerView
。使用NestedScrollView
而不是ScrollView
NestedScrollView
与ScrollView
类似,但它支持操作
作为新的和旧的上的嵌套滚动父级和子级
Android版本。默认情况下启用嵌套滚动
例如:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
使用属性android:nestedScrollingEnabled=“false”
进行平滑滚动。不要在滚动视图中使用RecyclerView
。使用NestedScrollView
而不是ScrollView
NestedScrollView
与ScrollView
类似,但它支持操作
作为新的和旧的上的嵌套滚动父级和子级
Android版本。默认情况下启用嵌套滚动
例如:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
使用属性android:nestedScrollingEnabled=“false”
进行平滑滚动。以下代码片段将帮助您使用RecyclerView的ScrollView实现滚动
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@drawable/scrollbar_black">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rlFiltersSearchEvent"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@drawable/action_bar_gradient">
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvListOfEventsMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/fab_margin"
android:layout_below="@+id/rlFiltersSearchEvent"
android:nestedScrollingEnabled="false"
android:scrollbars="none" />
</RelativeLayout>
</ScrollView>
希望它有帮助下面的代码片段将帮助您使用RecyclerView的ScrollView
实现滚动
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@drawable/scrollbar_black">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rlFiltersSearchEvent"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@drawable/action_bar_gradient">
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvListOfEventsMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/fab_margin"
android:layout_below="@+id/rlFiltersSearchEvent"
android:nestedScrollingEnabled="false"
android:scrollbars="none" />
</RelativeLayout>
</ScrollView>
希望对您有所帮助以上代码不起作用。如果scrollpost显示当前布局xml,则整个scrollview滚动。看起来您的文章主要是代码;请添加更多详细信息。但现在上面的代码根据数据调整大小不显示滚动选项我必须在一些固定大小后显示滚动选项,然后使用固定高度
到回收视图
使用属性布局高度
或布局重量
上面的代码不起作用。如果滚动,则整个滚动视图滚动当前布局xml。看起来您的帖子主要是代码;请添加更多详细信息。但现在上面的代码根据数据调整大小不显示滚动选项我必须在一些固定大小后显示滚动选项,然后使用固定高度
到回收视图
使用属性布局高度
或布局重量
上面的代码不起作用。如果滚动,则整个滚动视图滚动完全想要,我想你想要滚动多个recyclerview和一些recyclerview Horizontally上面的代码不起作用。整个scrollview滚动如果滚动你真正想要的,我想你想要滚动多个recyclerview和一些recyclerview Horizontallynetings滚动可滚动视图从来都不是一个好主意。试着在使用中使用“scrollview”“LinearLayout”和“inside-put”您所有的“RecyclerView”……可能是它的工作嵌套滚动视图从来都不是一个好主意。尝试在使用“LinearLayout”和“inside-put”您所有的“RecyclerView”的内部使用“ScrollView”……可能是它的工作