清单:最小版本14
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />风格:
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowBackground">@color/fondoObscuro</item>
<item name="android:actionBarStyle">@style/OnTheGoActionBar</item>
</style>
<!-- general styles for the action bar -->
<style name="OnTheGoActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:titleTextStyle">@style/TitleTextStyle</item>
<item name="android:background">@color/actionBarObscura</item>
<item name="android:actionOverflowButtonStyle">@style/CustomOverflow</item>
</style>我在AppBaseTheme和OnTheGoActionBar两种样式上都没有找到任何资源错误。
发布于 2014-04-24 19:53:15
有非常明确的理由有两个独立的values文件夹,特别是对于“主题化应用程序”
正如您在发布的代码中所看到的,我确信下面的代码来自values\styles.xml
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>我想提请您注意注释代码。
Theme customizations available in newer API levels can go in res/values-vXX/styles.xml
styles.xml是为了向后兼容性,将parent样式parent="android:Theme.Light"更改为parent="android:Theme.Holo.Light.DarkActionBar"
这是错误的,因为android:Theme.Holo.Light.DarkActionBar是在APILevel-14中引入的,参见这里的DarkActionBar Android文档。生成器查找Theme.Holo.Light.DarkActionBar,但无法找到它,因为它适用于新版本,因此您可以看到
I got the error no resource found, on both styles AppBaseTheme and OnTheGoActionBar
简单地将您的定制样式代码移动到values-v14\styles.xml,一切都会很好,如果您没有values\styles.xml提供的样式,请不要担心,除非您的minSdkVersion是14。
我希望你能理解。
https://stackoverflow.com/questions/23277965
复制相似问题