我有一个应用程序,是用android:Theme.Light创建的。我想把它改成Theme.AppCompat.Light.DarkActionBar,但我得到了
没有找到与给定名称“theme.appcompat.light.darkactionbar”匹配的资源
我有android-support-v4.jar,当我尝试添加appcompat_v7时,我会得到代码中的错误,比如R.我可以将DarkActionBar添加到这个项目中吗?不改变代码?
我有:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
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">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>我要:
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>发布于 2014-05-20 22:00:41
发布于 2014-05-20 22:00:13
如果您正在清单中执行此操作,请执行以下操作以设置整个应用程序的主题:
<application
...
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
...>在特定主题的XML中,您需要@style,因此放置以下内容:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">https://stackoverflow.com/questions/23770641
复制相似问题