I use the following layout and it works great on all versions except Android Nougat, where the title is cropped when it completely crashes.
<android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="300dp" android:fitsSystemWindows="true" app:contentScrim="@color/them_color" app:expandedTitleTextAppearance="@android:color/transparent" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <ImageView android:id="@+id/header_image" android:layout_width="match_parent" android:layout_height="300dp" android:contentDescription="@string/app_name" android:fitsSystemWindows="true" android:scaleType="fitXY" app:layout_collapseMode="parallax"/> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?android:attr/actionBarSize" app:layout_collapseMode="pin" app:contentInsetLeft="0dp" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> </android.support.design.widget.CollapsingToolbarLayout>
I tried app:collapsedTitleGravity="center"
, but this does not fix the problem. How can I get him to work on Nougat?
source share