本文介绍了找不到与给定名称'@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse'相匹配的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我的英语.我尝试更改操作栏科洛尔.而且我有这个错误:

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

我的minSdkVersion = 12

I have minSdkVersion = 12

style.xml

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

我添加了appcompat_v7,但是它不起作用

I have added appcompat_v7, but its not work

UPD

现在style.xml看起来:

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>

在清单中:

android:theme="@style/MyTheme" >

我有错误:

如果我这样更改清单:

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

没有错误,但是此后没有更改颜色操作栏

no error but after this no change color action bar

推荐答案

改为尝试@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse.

附带说明, appcompat_v7 上的styles.xml文件表明已弃用@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse. @android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse是替代方法.

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.

这篇关于找不到与给定名称'@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse'相匹配的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 01:37