Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在scrollview中滚动RecyclerView_Android_Xml_Android Recyclerview_Scrollview - Fatal编程技术网

Android 如何在scrollview中滚动RecyclerView

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中滚动所有上述RecyclerView

我必须在scrollview中实现RecyclerView,如下代码所示,但不能实现ScrollRecyclerView

请给出答案

            <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”……可能是它的工作