2016-07-06 10 views
0

Ich habe bemerkt, dass, wenn in actionBarTheme Stil Hintergrund Einstellung zusammen Attribut mit Hintergrund in popupMenuStyle style-Attribut festlegen:actionBarTheme Konflikte mit popupMenuStyle

<style name="AppTheme" parent="@style/Theme.AppCompat.Light"> 
    <item name="actionBarTheme">@style/MyActionBarTheme</item> 
    <item name="android:actionBarTheme">@style/MyActionBarTheme</item> 
    <item name="android:popupMenuStyle">@style/MyPopupMenu</item> 
    <item name="popupMenuStyle">@style/MyPopupMenu</item> 
</style> 

<style name="MyActionBarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar"> 
    <item name="background">@drawable/action_bar_background</item> 
    <item name="android:background">@drawable/action_bar_background</item> 
</style> 

<style name="MyPopupMenu" parent="@style/Widget.AppCompat.ListPopupWindow"> 
    <item name="android:popupBackground">@drawable/menu_dropdown_panel_example</item> 
</style> 

Der Hintergrund in der actionBarTheme die ActionBar bewirkt, sondern auch den Text in jedem Menüpunkt.

enter image description here

Jede Idee, wie dieses Problem zu lösen? Vielen Dank.

+0

verwenden Sie Toolbar? –

+0

@SohailZahid Nr. Android.support.v7.app.ActionBar. – AsafK

Antwort

0

Ich habe das gleiche Problem bei der Verwendung der Symbolleiste. So behoben.

<android.support.v7.widget.Toolbar     
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/themedDarkToolbarBackGroundColor" 
     android:titleTextAppearance="@color/White" 
     app:popupTheme="@style/MenuThemeDark"/> 

Verwendung Stil wie dieses

 <style name="MenuThemeDark" parent="@style/ThemeOverlay.AppCompat.Light"> 
     <item name="android:textColor">@color/DarkThemeConsListTitleName</item> 
     <item name="android:colorBackground">@color/DarkThemeColorBackground</item> 
    </style> 
+0

funktioniert nicht ... – AsafK