I'm playing around a bit to make an Android app using the new Material Design, but I can't figure out how to change the color of the text on the ActionBar.
I have this:
<style name="AppTheme" parent="@android:style/Theme.Material.Light">
<item name="android:colorPrimary">#ff3d00</item>
<item name="android:colorPrimaryDark">#dd2c00</item>
<item name="android:colorAccent">#ff3d00</item>
</style>
But that looks like this:
I don't really like the black text on the orange background. I tried to do this:
<style name="AppTheme" parent="@android:style/Theme.Material">
<item name="android:colorPrimary">#ff3d00</item>
<item name="android:colorPrimaryDark">#dd2c00</item>
<item name="android:colorAccent">#ff3d00</item>
</style>
And that looks like this:
As you can see, the color of the ActionBar text did change, but the background became grey, which I don't like.
How exactly am I supposed to do this? Thanks in advance!
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have taken text view to show status bar tittle.
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.
I think in this case it's enough to change the style to Theme.Material.Light.DarkActionBar. You'll get the light interface elements, but a 'dark' ActionBar with a light title text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With