Change Android 5.0 Actionbar color

前端 未结 1 1321
花落未央
花落未央 2020-12-01 13:34

I\'m working with the new Lollipop Material Design guidelines and would like to incorporate that nifty navigation drawer animation in my app. I\'ve gotten that far, by using

相关标签:
1条回答
  • 2020-12-01 14:05

    AppCompat does not use the android: prefixed attributes for the Material Theme color palette items per the migration guide to v21 by the author of AppCompat. Instead, just use the names themselves:

    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    
        <item name="colorPrimary">@color/primaryDef</item>
        <item name="colorPrimaryDark">@color/primaryDarkDef</item>
        <item name="colorAccent">@color/primaryDef</item>
    
        <item name="android:navigationBarColor">@color/primaryDarkDef</item>
        <item name="android:activatedBackgroundIndicator">@drawable/defbg</item>
    </style>
    

    The Action Bar will be colored by colorPrimary.

    0 讨论(0)
提交回复
热议问题