简体   繁体   English

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

[英]Cannot change app theme to Holo Dark

I'm currently using Holo light with dark action bar and I want to change my app to completely use Holo.我目前正在使用带有深色操作栏的 Holo light,我想更改我的应用程序以完全使用 Holo。 I changed styles.xml from我改变了styles.xml

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

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

and I changed styles.xml within values-14 from我在 values-14 内从

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

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

yet nothing changes.但没有任何变化。 I set my minSDK to 14 and my target to 19. Anyone know what's wrong?我将 minSDK 设置为 14,将目标设置为 19。有人知道出了什么问题吗?

I would check the AndroidManifest.xml file.我会检查 AndroidManifest.xml 文件。 There should be a node called: android:theme.应该有一个名为:android:theme 的节点。 Change it to android:theme="Theme.Holo.Light" >将其更改为 android:theme="Theme.Holo.Light">

See AndroidManifest.xml probably there is some lines like this:AndroidManifest.xml可能有一些这样的行:

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

this lines set a dynamic theme for your application that depend on SDK-level.此行为您的应用程序设置了一个动态主题,该主题取决于 SDK 级别。 you can set values for each SDK by adding values-vxx/styles.xml like values-v10/styles.xml for SDK-10.您可以通过添加values-vxx/styles.xml为每个 SDK 设置值,如 SDK-10 的values-v10/styles.xml

but your minimum SDK is 14 that support Holo and Holo.Light themes so you can change theme directly in manifest.但是您的最小 SDK 是 14,支持 Holo 和 Holo.Light 主题,因此您可以直接在清单中更改主题。

So write in AdnroidManifest.xml like this:所以在 AdnroidManifest.xml 中这样写:

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

write "@android:style/Theme.Holo" because you're using android resources."@android:style/Theme.Holo"因为你正在使用 android 资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM