2016-03-05 87 views
0

我是业余的android开发和我一直在eclipse上的项目。我已经完成了我的android:minSdkVersion =“21”和android:targetSdkVersion =“22”,并在API上的项目构建目标在21以下是我的style.xml中的错误错误:没有发现资源匹配给定的名称:attr'colorAccent'在Eclipse中

[2016-03-05 15: 55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:12:错误:错误:找不到与给定名称匹配的资源:attr'colorAccent'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:10:error :错误:找不到与给定名称匹配的资源:attr'colorPrimary'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:11:error :错误:找不到与给定名称匹配的资源:attr'colorPrimaryDark'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:8:error :错误:找不到与给定名称匹配的资源:attr'windowNoTitle'。

这里是style.xml

<resources> 

    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base"> 

    </style> 

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="windowNoTitle">true</item> 
     <item name="windowActionBar">false</item> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 

</resources> 

的XML代码,我用做什么,我会很高兴,如果有人可以帮助我这个问题有点混乱。提前致谢。

回答

0

使用这些属性为:

<resources> 
    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base">  
    </style> 

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="android:windowNoTitle">true</item> 
     <item name="android:windowActionBar">false</item> 
     <item name="android:colorPrimary">@color/colorPrimary</item> 
     <item name="android:colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="android:colorAccent">@color/colorAccent</item> 
    </style> 

</resources> 
+0

感谢您的帮助!我很抱歉用这么小的逻辑来打扰。 –

相关问题