The contentScrim attribute in CollapsingToolbarLayout can control the background color of the toolber after folding

The contentScrim attribute in CollapsingToolbarLayout can control the background color of the toolber after folding

app:contentScrim="@color/actionbar_icon_color"

<CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="270dp"
            android:fitsSystemWindows="true"
            app:contentScrim="@color/actionbar_icon_color"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">
            
            <android.support.v7.widget.Toolbar......

Control in code

toolbarLayout.setContentScrimResource(R.color.black);

Guess you like

Origin blog.csdn.net/yanwenyuan0304/article/details/107864672