有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java水平循环视图内部循环视图内部协调布局

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

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

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

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

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

这是我的ViewHodler:

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

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

ViewHolder的RecyclerView是水平的。主要活动的回收视图是垂直的。如果我将ViewHolder的RecyclerView更改为View,则塌陷工具栏布局是可以的。我的问题是,如何使用ViewHolder的RecyclerView,同时让折叠工具栏布局工作


共 (0) 个答案