Android AppCompat灯光返回黑色操作栏而不是白色
我有一个问题,当开始一个android项目,并选择全息灯,应该创建一个项目的行动栏在白色。但是我得到了黑色的操作栏(还有子菜单) 但是,如果我使用菜单按钮打开子菜单,而不是从操作栏打开子菜单,则子菜单将显示为灯光主题的样式 为什么我会遇到这个奇怪的问题 这是舱单:Android AppCompat灯光返回黑色操作栏而不是白色,android,android-actionbar,android-theme,android-styles,Android,Android Actionbar,Android Theme,Android Styles,我有一个问题,当开始一个android项目,并选择全息灯,应该创建一个项目的行动栏在白色。但是我得到了黑色的操作栏(还有子菜单) 但是,如果我使用菜单按钮打开子菜单,而不是从操作栏打开子菜单,则子菜单将显示为灯光主题的样式 为什么我会遇到这个奇怪的问题 这是舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.actionbar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.actionbar.MainActivity"
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>
这是style.xml:
<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="Theme.AppCompat.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>
我想您忘记了
@style/
属性,如下所示:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
根据下面的评论进行更新:确保res/values-v14/
中的style.xml
与上面的snippnet代码主题相同。如果有帮助,请告诉我。嗨。不,我也遇到同样的问题。@user2030307您是否尝试在其他设备上进行测试?您当前的设备是什么?将sur your style.xml inside values-v14作为相同的父主题。这就是问题所在!values-v14文件夹中的主题是,但为什么会发生这种情况?是一只虫子吗?谢谢@user2030307不,这不是一个bug。这是当前创建Android项目的方式。SDK为您提供了低级API的轻主题和高级API的DarkActionBar。全息主题也一样很乐意帮忙。