

Then just include your toolbar layout in your other layouts In order to actually get the background colors I was hoping for you have to override the background attribute in your Toolbar themes So apply themes explicitly to your Toolbars like in oRRs answer I'm making it a separate answer so I can get everything in one place.įirstly, don't try to get the toolbars to play nice through just themes. Ok after having sunk way to much time into this problem this is the way I managed to get the appearance I was hoping for. The app:theme is instead global to all ui elements inflated in the Toolbar, for example the color of the title and icons.


They are different! The style is local to the Toolbar view, for example the background color. With the new Toolbar you can apply a style and a theme. Update: A quote from Gabriele Mariotti's blog. Note: This means I am using a Toolbar provided by the framework (NOT included in an XML file). You will find a good example of this is in the current project template with an Empty Activity of Android Studio (1.4+).Įdit: After updating to appcompat-v7:22.1.1 and using AppCompatActivity instead of ActionBarActivity my styles.xml looks like: Also note that this will pick up your ?attr/colorPrimary if you have set it in your main style so you might get a different background color. Then use the following as your Toolbar: įor further modifications, you would create styles extending and replacing the ones within AppBarLayout->android:theme and Toolbar->app:popupTheme. The recommended way to style the Toolbar for a Light.DarkActionBar clone would be to use as parent/app theme and add the following attributes to the style to hide the default ActionBar: false true
