android - When click on OptionMenu it shows black background on kitkat -
when clicking on optionmenuitem on toolbar shows black background . getting issue on kitkat device , working on lollipop , higher
// toolbar using <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorprimary" android:minheight="?attr/actionbarsize" local:popuptheme="@style/mycustompopuptheme" local:theme="@style/toolbarcustomtheme" /> // mycustompopuptheme theme works correctly <style name="mycustompopuptheme" parent="themeoverlay.appcompat.light"> <item name="windownotitle">true</item> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/coloraccent</item> <item name="actionmenutextcolor">@color/white</item> <item name="android:background">@color/white</item> <!-- item setting background color of item selected list --> <item name="listchoicebackgroundindicator">@color/white</item> </style> // toolbarcustomtheme theme here getting issue extending themeoverlay.appcompat.dark.actionbar theme <style name="toolbarcustomtheme" parent="themeoverlay.appcompat.dark.actionbar"> <item name="windownotitle">true</item> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/coloraccent</item> <item name="actionmenutextcolor">@color/white</item> <item name="android:background">@color/colorprimary</item> <item name="background">@color/colorprimary</item> </style>
try setting alpha when defining colors. if want red, instead of #ff0000 define #ffff0000.
in case @color/white simple #ffffff, use predefined @android:color/white. theres couple predefined ones.
Comments
Post a Comment