<style name="Theme.RateItTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:titleTextStyle">@style/MyActionBar.Text</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#2E495E</item>
</style>
<style name="MyActionBar.Text" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#ECECEC</item>
</style>
I have been able to change the background, but not the text color. Or the overflow menu "three dots". My code is above.
This example demonstrate about how to create a custom action bar in Android. 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.
toolbar. setBackgroundColor(Color. parseColor("#80000000"));
You need to move your titleTextStyle
attribute into your MyActionBar
style. Do you understand why it's supposed to be placed there rather than where you had it originally?
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#2E495E</item>
<item name="android:titleTextStyle">@style/MyActionBar.Text</item>
</style>
As far as changing the Overflow icon, I think that's what mean when you say "three dots", I've already written a post about that here.
Try this
<?xml version="1.0" encoding="utf-8"?>
<!-- For honeycomb and up -->
<resources>
<style name="Theme.RateItTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionMenuTextColor">@color/actionBarText</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#2E495E</item>
<item name="android:titleTextStyle">@style/MyActionBar.Text</item>
</style>
<style name="MyActionBar.Text" parent="@android:style/TextAppearance">
<item name="android:textColor">#ECECEC</item>
</style>
</resources>
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