2

I am using the Toolbar as an actionbar. As such I would like the toolbar style to reflect that of what the action bar would look like. IE background=colorPrimary and in my case title color = white.

I would like to do this with a simple style if possible but I cannot seem to get it to work.

First thing I am trying to do is extend the Toolbar style:

<style name="AppTheme.Toolbar" parent="@style/Widget.AppCompat.Toolbar">
    <item name="android:textColorPrimary">@color/white</item>
    <item name="android:background">?attr/colorPrimary</item>
</style>

Then in my style I try and use that toolbar style:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>

    <item name="toolbarStyle">@style/AppTheme.Toolbar</item>
</style>

However when I do that the text color is not white, its black

I have looked at a ton of posts and I am not really sure what gives. Is there an easy way to style all toolbars in my app?

lostintranslation
  • 23,756
  • 50
  • 159
  • 262
  • Have you tried this? http://stackoverflow.com/questions/26503149/how-do-i-style-appcompat-v7-toolbar-like-theme-appcompat-light-darkactionbar – Trey Cai Jan 25 '17 at 03:24
  • 2
    Yup. And most of those answers are setting the theme in the toolbar itself. I am trying to get around setting each and every one and creating a style that covers all toolbars under the "AppTheme" I have created. – lostintranslation Jan 25 '17 at 15:34

0 Answers0