如何在ActionBar的“溢出”菜单中显示图标

我知道使用原生API是不可能的。有没有解决方法来实现这种观点?

PIPIONE
浏览 331回答 3
3回答

跃然一笑

在菜单xml中,使用以下语法嵌套菜单,您将开始获取带有图标的菜单<item&nbsp; &nbsp; android:id="@+id/empty"&nbsp; &nbsp; android:icon="@drawable/ic_action_overflow"&nbsp; &nbsp; android:orderInCategory="101"&nbsp; &nbsp; android:showAsAction="always">&nbsp; &nbsp; <menu>&nbsp; &nbsp; &nbsp; &nbsp; <item&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/action_show_ir_list"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:icon="@drawable/ic_menu_friendslist"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:showAsAction="always|withText"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:title="List"/>&nbsp; &nbsp; </menu></item>
打开App,查看更多内容
随时随地看视频慕课网APP