在我的清单中,应用程序主题指向 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>
样式.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 中,因此可以正常识别文件。有没有人有任何其他想法可能是什么问题?