Jemshit
Jemshit

Reputation: 10048

Android Light AppTheme with Dark ActionBar (AppCompat)

I have Application Theme Theme.AppCompat.Light.NoActionBar which gives light theme to my App, so texts on Dialogs etc are dark. I want also my Toolbar have dark background and light foreground, so i write these to Toolbar:

app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"

Problem: This makes Toolbar dark and texts, back icon white on Lollipop, but does NOT work on KitKat:

Lollipop:

enter image description here


KitKat: enter image description here

Question: How to make Dark Toolbar with Light content on KitKat with my current theme Theme.AppCompat.Light.NoActionBar ?

Upvotes: 3

Views: 7156

Answers (1)

Strider
Strider

Reputation: 4500

Try this:

<style name="MyToolbarStyle" parent="Theme.AppCompat.Light">
    <!-- Used to for the title of the Toolbar -->
    <item name="android:textColorPrimary">#fff</item>
    <!-- Used to for the title of the Toolbar when parent is Theme.AppCompat.Light -->
    <item name="android:textColorPrimaryInverse">#fff</item>
    <!-- Used to color the text of the action menu icons -->
    <item name="android:textColorSecondary">#fff</item>
    <!-- Used to color the overflow menu icon -->
    <item name="actionMenuTextColor">#fff</item>
    <!-- Color of the Toolbar -->
    <item name="android:background">#455a64</item>
</style>

Check out this post:

Android Theme.AppCompat.Light with Dark Toolbar (for light text)

Upvotes: 0

Related Questions