我想除了菜单项冠军溢出下拉菜单中显示的图标。
I want to display icon in addition to menu item title in overflow dropdown menu.
是可能的吗?
把你的菜单与地产安卓showAsAction =总是
键,菜单的XML文件中添加子根据该菜单比如你的菜单
put your menu with property android:showAsAction="always"
and in xml file of menu add sub menus under that your menu like this
<item
android:id="@+id/mainMenu"
android:icon="@drawable/launcher"
android:showAsAction="always">
<menu>
<item
android:id="@+id/menu_logout"
android:icon="@drawable/log_out"
android:title="logout"/>
</menu>
</item>
这将显示在菜单中的图标
this will show the icons in menus