如何在Android中将菜单更改为holo dark主题?

时间:2014-06-29 18:49:46

标签: android menu android-theme

在我的Android应用程序中,当我在我的活动中打开内置菜单时,它显示为白色。 如何将其更改为黑暗主题?

我在这里尝试解决方案:

Dark actionbar with white dropdown menu from Holo Light

但它没有工作。

到目前为止,我有这个

<style name="AppBaseTheme" parent="android: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. -->
    <item name="android:actionBarWidgetTheme">@style/YourActionBarWidget</item>
</style>

<style name="YourActionBarWidget" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:popupMenuStyle">@android:style/Widget.Holo.DarkActionBar.PopupMenu</item>
</style>

有谁知道如何让它发挥作用?

由于

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="android.arin"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="android.arin.SplashScreen"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="android.arin.LoginScreen"
            android:label="@string/title_activity_login_screen"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:name="android.arin.MenuScreen"
            android:label="@string/title_activity_menu_screen"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="android.arin.NavigationScreen"
            android:label="@string/title_activity_navigation_screen" 
            android:screenOrientation="portrait" >
        </activity>
    </application>

</manifest>

0 个答案:

没有答案