首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我的应用程序不再有全息主题,我不知道为什么

我的应用程序不再有全息主题,我不知道为什么
EN

Stack Overflow用户
提问于 2013-05-22 16:53:27
回答 1查看 1.6K关注 0票数 0

我不知道我做了什么改变,但是我的应用突然从全息主题变成了普通的旧主题。我在一台运行android 4.2.2的Nexus 4上运行它

现在:

之前:

以下是我的清单:

代码语言:javascript
复制
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="..."
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

值-v14/styles.xml

代码语言:javascript
复制
<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="android:Theme.Holo.Light.DarkActionBar">
        <!-- API 14 theme customizations can go here. -->
    </style>

</resources>

值-v11/styles.xml

代码语言:javascript
复制
<resources>

    <!--
        Base application theme for API 11+. This theme completely replaces
        AppBaseTheme from res/values/styles.xml on API 11+ devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
        <!-- API 11 theme customizations can go here. -->
    </style>

</resources>

values-de/styles.xml:

代码语言:javascript
复制
<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>

values/styles.xml

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-22 17:58:01

布局中使用的样式

代码语言:javascript
复制
<style name="AppTheme"> 

仅在常规的'values/styles.xml‘中定义,而不是在values-v11和values-v14的样式中定义。尝试在您的v11和v14 styles.xml中使用"AppTheme“。parent标记从相同的styles.xml文件继承父标记,并且api级别的判断在这里不起作用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16687475

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档