Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android清单没有';无法识别styles.xml中列出的系统主题_Android_Xml_Styles_Themes_Manifest - Fatal编程技术网

Android清单没有';无法识别styles.xml中列出的系统主题

Android清单没有';无法识别styles.xml中列出的系统主题,android,xml,styles,themes,manifest,Android,Xml,Styles,Themes,Manifest,在我的清单中,应用程序主题指向styles.xml文件中列出的android样式: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.theme" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="16" android:ta

在我的清单中,应用程序主题指向styles.xml文件中列出的android样式:

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android"
package="test.theme"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

styles.xml:

<resources>
    <style name="AppTheme" parent="android:Theme.Black" />
</resources>

但由于某些原因,该主题未被识别,而是加载了一个白色主题。但是,当我将主题直接放入清单时,它的功能与预期一样,如下所示:

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


即使在空的默认项目中,也会出现相同的问题。AppTheme的值列在R.java中,因此可以识别该文件。有没有人对这个问题有其他的想法?

我最终解决了这个问题,最终它是一个非常简单的问题

有一个特定于平台的values-v14/styles.xml文件,我应该将我的样式放入其中,因为此表中的默认值优先于我对全局values/styles.xml文件所做的更改


因此,如果有人在这里遇到同样的问题,您可能需要检查您是否为您的目标平台保存了正确的styles.xml文件。

您是否尝试过在styles.xml中使用parent=“@android:style/Theme.Black”而不是现在的版本?是的,我刚刚尝试过,也许你的答案就在另一条线上:嗨,谢谢你的帮助,谢谢你的帮助!