滚动RecyclerView时隐藏视图(不隐藏工具栏)

时间:2015-10-22 22:17:19

标签: android

我有以下布局,我想隐藏LinearLayout“cv”及其包含在工具栏后面的子项。

我搜索了它并找到了很多隐藏工具栏的示例,但没有一个让我隐藏任何其他视图而不是工具栏(example)。是否有可能使用CoordinatorLayout进行此操作?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="de.app.activities.AccountDetail">

    <include
        android:id="@+id/app_bar"
        layout="@layout/app_bar" />

    <LinearLayout
        android:id="@+id/cv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/app_bar">

        <include layout="@layout/single_account" />
    </LinearLayout>

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/cv">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>

0 个答案:

没有答案