I have a search on how to customize a toolbar and, for example, add a background color, but I donβt understand how it works.
I am trying to add my own style to my toolbar, but any result ...
Manifesto
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Design">
File style.xml
<resources> <style name="Theme.Design" parent="Base.Theme.Design"> </style> <style name="Base.Theme.Design" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/red</item> <item name="colorPrimaryDark">@color/red</item> <item name="colorAccent">@color/red</item> <item name="android:textColorPrimary">@color/white</item> <item name="android:windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item> </style> ...
And the toolbar in the layout
<android.support.v7.widget.Toolbar android:id="@+id/home_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"/>
source share