2015-12-19 67 views
0

我儘量把我的主題我的應用程序,但我不能修復它 - enter image description here無法設置我的主題

我看到在白色背景下的白色文字 - 如何在ActionBar彈出從白到黑改變文字顏色?

這是我的主題:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 

    <item name="colorPrimary">@color/material_bg</item> 
    <item name="colorPrimaryDark">@color/status_bar</item> 
    <item name="colorAccent">@color/edittext_primary</item> 
    <item name="android:windowBackground">@color/light_blue</item> 

    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 

    <item name="android:textColorPrimaryInverse">@android:color/white</item> 

    <item name="android:textColorPrimary">@android:color/white</item> 

    <item name="actionMenuTextColor">@android:color/white</item> 

    <item name="android:textColorSecondary">@android:color/white</item> 

    <item name="drawerArrowStyle">@style/WhiteDrawerIconStyle</item> 

    <item name="textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge</item> 
    <item name="android:textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge</item> 

    <item name="textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall</item> 
    <item name="android:textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall</item> 

    <item name="popupMenuStyle">@style/myPopupMenuStyle</item> 
    <item name="android:popupMenuStyle">@style/myPopupMenuStyle</item> 
</style> 

<style name="myPopupMenuStyle" parent="@style/Widget.AppCompat.PopupMenu"></style> 
<style name="myPopupMenuTextAppearanceSmall" parent="@style/TextAppearance.AppCompat.Light.Widget.PopupMenu.Small"> 
    <item name="android:textColor">#000000</item> 
</style> 
<style name="myPopupMenuTextAppearanceLarge" parent="@style/TextAppearance.AppCompat.Light.Widget.PopupMenu.Large"> 
<item name="android:textColor">#000000</item> 
</style> 
+0

你已經使用工具欄(android.support.v7.widget.Toolbar)在你的活動佈局? –

+0

@DhawalSodhaParmar是的,我使用工具欄 – Artem

+0

然後在工具欄中更改彈出式主題 - >應用程序:popupTheme =「@ style/ThemeOverlay.AppCompat.Light」或任何你想要的 –

回答

0

試試這個主題,如果你正在使用android.support.v7.widget.Toolbar,

它會解決你的問題。

app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
+0

它不能幫助我( – Artem

1

將這個風格水庫,

<style name="MyAppActionBarTheme" parent="android:Theme.Holo.Light"> 
     <item name="android:popupMenuStyle">@style/MyApp.PopupMenu</item> 
     <item name="android:actionBarStyle">@style/MyApp.ActionBar</item> 
    </style> 

    <!-- The beef: background color for Action Bar overflow menu --> 
    <style name="MyApp.PopupMenu" parent="android:Widget.Holo.Light.ListPopupWindow"> 
     <item name="android:popupBackground">@drawable/menu_dropdown_panel</item> 
    </style> 

    <!-- Bonus: if you want to style whole Action Bar, not just the menu --> 
    <style name="MyApp.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid"> 
     <!-- Blue background color & black bottom border --> 
     <item name="android:background">@drawable/blue_action_bar_background</item> 
    </style> 

,當然,在AndroidManifest.xml:

<application 
    android:theme="@style/MyAppActionBarTheme" 
    ... > 

您在此設置能得到什麼:

enter image description here