0

I have the following styles.xml:

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Main theme colors -->
        <item name="android:colorPrimary">@color/primary</item>
        <item name="android:colorPrimaryDark">@color/primary_dark</item>
        <item name="android:colorAccent">@color/accent</item>
    </style>
</resources>

Where primary is defined as:

 <color name="primary">#9c27b0</color>

However in the preview the actionbar is still black and not deep purple. When i open the theme editor the actionbar is also deep purple. Is this a bug in the preview? Or have i done something wrong? In general how exactly do i use the styles.xml? Can i also define button's in it?

greedsin
  • 1,252
  • 1
  • 24
  • 49

1 Answers1

0

After editing the color code in the color.xml file, you should rebuild it. Try rewriting the code and then rebuilding. I faced the same problem, that's ho