具有自定义voew stranche行为的CollapseToolbar

时间:2015-12-27 19:35:26

标签: android android-collapsingtoolbarlayout

我有一个collapsetoolbar,其自定义视图为子,而不是工具栏,由imageview和其他图像视图组成。 当我滚动并且视图折叠时。儿童imageview永远消失,不再出现了。

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            app:toolbarId="@+id/action_bar"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">
            <com.rbrlnx.cover.GroupSummaryCoverView
                    android:layout_below="@id/action_bar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/group_summary_cover_view"
                    app:layout_collapseMode="parallax"
                    app:layout_collapseParallaxMultiplier="0.8"/>

    </android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>

    <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <include layout="@layout/group_info_title_view"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="@dimen/group_detail_components_lateral_margin"
                 android:layout_marginRight="@dimen/group_detail_components_lateral_margin"
                 android:layout_marginLeft="@dimen/group_detail_components_lateral_margin"/>

        <View android:id="@+id/name_setting_divider"
              android:layout_height="@dimen/space_medium"
              android:layout_width="match_parent"
              style="@style/group_detail_list_top_divider"/>

        <android.support.v7.widget.RecyclerView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/lv_participants"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
    </LinearLayout>

这是自定义视图

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
                       android:layout_height="wrap_content"
                       android:layout_width="match_parent">
    <ImageView
            android:id="@+id/iv_group_cover"
            android:layout_width="match_parent"
            android:layout_height="@dimen/group_profile_cover_height"
            android:src="@color/color_pepper"/>
    <FrameLayout android:id="@+id/fl_edit_cover"
                 android:layout_width="@dimen/space_xxxlarge"
                 android:layout_height="@dimen/space_xxxlarge">
        <ImageView android:layout_width="@dimen/space_large"
                   android:layout_height="@dimen/space_large"
                   android:layout_margin="@dimen/space_large"
                   android:src="@drawable/icn_edit_pencil_white"/>
    </FrameLayout>
</merge>

对此有何想法?

0 个答案:

没有答案