I have an Issue making \" toolbar with Title text \" Not to Collapse while scrolling upwards in CollapsingToolbarLayout.
I have tried a few tweaks, by using
In your toolbar do this:
app:layout_collapseMode="pin"
pin is used for pinning the layout to top when the collapsing toolbar layout scrolls
parallax is used for hiding the layout when collapsing toolbar scrolls to top
try this...
You have to use app:layout_scrollFlags="scroll|exitUntilCollapsed" instead of app:layout_scrollFlags="scroll|enterAlways" inside the CollapsingToolbarLayout
and use app:layout_collapseMode="pin" inside the toolbar
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:contentScrim="?attr/colorPrimary" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="250dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7" >
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#20000000" />
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Application Title"
android:textColor="#fff"
android:textSize="18sp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>