iamyours/FlingAppBarLayout

app:layout_collapseMode="pin" not work

susyimes opened this issue · 2 comments

app:layout_collapseMode="pin" not work

could not pin a toobar or view in collasingtoolbarlayout

<io.github.iamyours.flingappbarlayout.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collap"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="0dp"
            android:minWidth="44dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            >

            <ImageView
                android:id="@+id/img1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#fff"
                />
            <android.support.v7.widget.Toolbar
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="#aaeeaa"
                app:layout_collapseMode="pin"
                ></android.support.v7.widget.Toolbar>
            <View
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:background="#ff6600"
                app:layout_collapseMode="pin"
                ></View>

        </android.support.design.widget.CollapsingToolbarLayout>
</io.github.iamyours.flingappbarlayout.AppBarLayout>

已修复
CollapsingToolbarLayout的包名改下

<io.github.iamyours.flingappbarlayout.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="0dp">
<io.github.iamyours.flingappbarlayout.CollapsingToolbarLayout
            android:id="@+id/collap"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="0dp"
            android:minWidth="44dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            >

            <ImageView
                android:id="@+id/img1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#fff"
                />
            <android.support.v7.widget.Toolbar
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="#aaeeaa"
                app:layout_collapseMode="pin"
                ></android.support.v7.widget.Toolbar>
            <View
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:background="#ff6600"
                app:layout_collapseMode="pin"
                ></View>

        </io.github.iamyours.flingappbarlayout.CollapsingToolbarLayout>
</io.github.iamyours.flingappbarlayout.AppBarLayout>