猿问

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

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



守着星空守着你
浏览 631回答 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

相关分类

Android
我要回答