Android menu item background

前端 未结 2 1074
无人及你
无人及你 2021-01-07 08:41

I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried this solution a

相关标签:
2条回答
  • 2021-01-07 09:02

    The style attribute for the menu background is android:panelFullBackground. It's not hackish like the other solution, so it's not as buggy.

    Despite what the documentation says, it needs to be a resource (e.g. @android:color/black or @drawable/my_drawable), it will crash if you use a color value directly.

    0 讨论(0)
  • 2021-01-07 09:04

    try to use android own menu icon like as setIcon(android.R.drawable.ic_menu_search)

    0 讨论(0)
提交回复
热议问题