Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.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
Java 水平回收器查看内部回收器查看内部协调器布局_Java_Android_Android Layout_Android Fragments_Android Activity - Fatal编程技术网

Java 水平回收器查看内部回收器查看内部协调器布局

Java 水平回收器查看内部回收器查看内部协调器布局,java,android,android-layout,android-fragments,android-activity,Java,Android,Android Layout,Android Fragments,Android Activity,如果RecyclerView的ViewHolder包含另一个水平RecyclerView,则我的折叠工具栏布局不适用于RecyclerView。有人能帮我吗?首先谢谢大家。 我的主要Xml是: <?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android

如果RecyclerView的ViewHolder包含另一个水平RecyclerView,则我的折叠工具栏布局不适用于RecyclerView。有人能帮我吗?首先谢谢大家。 我的主要Xml是:

<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/circlebd_rootview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="256dip"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                android:src="@drawable/header"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.4" />

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:minHeight="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
    android:id="@+id/circleinfo_recycler"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/recyclerbg"
    android:fillViewport="true"
    android:layout_marginBottom="?attr/actionBarSize"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/></android.support.design.widget.CoordinatorLayout>

这是我的ViewHodler:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dip"
android:background="@color/gray_light"
android:paddingBottom="1dp">
<RelativeLayout
    android:id="@id/con_item_r1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/contentitem_top"
    android:paddingBottom="10dip">

</RelativeLayout>
<android.support.v7.widget.RecyclerView
    android:id="@id/con_item_recyclerview"
    android:layout_width="match_parent"
    android:layout_height="@dimen/showimg_height"
    android:layout_below="@id/con_item_r1"/>


ViewHolder的RecyclerView是水平的,而main activity的RecyclerView是垂直的。如果我将ViewHolder的RecyclerView更改为View,则塌陷工具栏布局是可以的。我的问题是如何使用ViewHolder的RecyclerView,并让折叠工具栏布局工作。

我遇到了一个与您非常相似的问题,我就是这样设法解决的:


这将起作用。

您还可以通过指定以下属性在xml布局文件中进行设置:

android:nestedScrollingEnabled="false"
android:nestedScrollingEnabled="false"