我是android开发的业余爱好者,我一直在做一个关于eclipse的项目。我已经完成了我的android:minSdkVersion=" 21“和android:targetSdkVersion="22”,并在21上构建了项目目标。以下是我的style.xml中的错误
2016-03-05 15:55:13 - Iot C:\工作区\物联网\res\style1.xml:12: error: Error:没有找到与给定名称attr 'colorAccent‘匹配的资源。
2016-03-05 15:55:13 -物联网C:\工作区\物联网\res\style1.xml:10: error: Error:没有找到与给定名称attr 'colorPrimary‘匹配的资源。
2016-03-05 15:55:13 - Iot C:\工作区\物联网\res\style1.xml:11: error: Error:没有找到与给定名称attr‘彩色colorPrimaryDark’匹配的资源。
2016-03-05 15:55:13 - Iot C:\工作区\物联网\res\style1.xml:8: error: Error:没有找到与给定名称attr 'windowNoTitle‘匹配的资源。
以下是style.xml的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>我有点搞不懂该怎么办,如果有人能帮我解决这个问题,我会很高兴的。提前谢谢。
发布于 2016-03-05 10:55:27
将这些属性用作:
<resources>
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base" />
<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>https://stackoverflow.com/questions/35813050
复制相似问题