无法将应用主题更改为Holo Dark

时间:2014-05-27 21:32:41

标签: java android eclipse

我目前正在使用带有暗动作条的Holo灯,我想更改我的应用以完全使用Holo。我从

更改了styles.xml

"<style name="AppBaseTheme" parent="android:Theme.Holo.Light">"

"<style name="AppBaseTheme" parent="android:Theme.Holo ">" 

我在

的值-14中更改了styles.xml

"<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">"

"<style name="AppBaseTheme" parent="android:Theme.Holo.">" 

但没有任何改变。我将minSDK设置为14,将目标设置为19.任何人都知道错误了什么?

2 个答案:

答案 0 :(得分:1)

我会查看AndroidManifest.xml文件。应该有一个名为:android:theme的节点。将其更改为android:theme =“Theme.Holo.Light”&gt;

答案 1 :(得分:0)

请参见AndroidManifest.xml,可能有一些类似这样的行:

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >  <!-- this line -->

此行为您的应用程序设置动态主题,该主题取决于SDK级别。您可以通过为SDK-10添加values-vxx/styles.xml之类的values-v10/styles.xml来为每个SDK设置值。

但是您的最小SDK为支持Holo和Holo.Light主题的14个,因此您可以直接在清单中更改主题。

因此,像这样在AdnroidManifest.xml中编写:

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo" >

"@android:style/Theme.Holo"是因为您正在使用android资源。