asdascascaedfa
asdascascaedfa

Reputation: 137

No resource found that matches the given name '@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse'

Sorry for my english. I try change action bar collor. And i have this error:

error: Error retrieving parent for item: No resource found that matches the given name '@android:style/ Widget.AppCompat.Light.ActionBar.Solid.Inverse'.

I have minSdkVersion = 12

style.xml

    <resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
         <item name="android:actionBarStyle">@style/MyActionBar</item>

      </style>

//this is error
      <style name="MyActionBar" parent="@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
         <item name="android:background">#FF9D21</item> 
      </style> 
     </resources>

UPD

I have added appcompat_v7, but its not work

enter image description here

UPD

now style.xml looking that:

<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
             <item name="android:actionBarStyle">@style/MyActionBar</item>

          </style>


          <style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
             <item name="android:background">#FF9D21</item> 
          </style> 

in manifest:

android:theme="@style/MyTheme" >

i have error:

03-05 12:45:33.860: E/AndroidRuntime(2006): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test6/com.example.test6.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

if i change manifest like that:

android:theme="@style/Theme.AppCompat" >

no error but after this no change color action bar

Upvotes: 1

Views: 8629

Answers (3)

trustidkid
trustidkid

Reputation: 557

This works for me

<style name="AppBarStyle" parent="@android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse">

Upvotes: 0

Boycott A.I.
Boycott A.I.

Reputation: 18961

I had this problem in my v21\styles.xml file.

Solution:

parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse"

Upvotes: 4

walljam7
walljam7

Reputation: 343

Try @style/Widget.AppCompat.Light.ActionBar.Solid.Inverse instead .

On a side note, the styles.xml file on appcompat_v7 suggests that @style/Widget.AppCompat.Light.ActionBar.Solid.Inverseis deprecated. @android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse is an alternative.

Upvotes: 8

Related Questions