joshua majebi joshua majebi - 1 year ago 93
Android Question

Changing the foreground color of the toolbar of an android app from black to white

So i am trying to change the foreground i.e color of the text, icons, back navigation button all to white of my apps toolbar.

My colors file is like so.

<color name="colorPrimary">#0277bd</color> blue
<color name="colorPrimaryDark">#01579b</color> dark blue
<color name="textColorPrimary">#FFFFFF</color> white
<color name="windowBackground">#e0e0e0</color> light grey
<color name="navigationBarColor">#000000</color> black
<color name="colorAccent">#26A69A</color> turquoise
<color name="twitter_btn_background">#4099FF</color> blue

My style config is like so.

<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="drawerArrowStyle">@style/DrawerIcon</item>

<item name="android:actionBarStyle">@style/MyActionBar</item>

<!-- Support library compatibility -->
<item name="actionBarStyle">@style/MyActionBar</item>

But this gives a black foreground on the apps toolbar. Just wondering what theme i should use to give a white foreground.

Answer Source

You could simply apply a dark actionbar theme to your Toolbar.

For example:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download