如何显示在动作条上溢菜单图标? [英] How to show icons in ActionBar overflow menu?

查看:168
本文介绍了如何显示在动作条上溢菜单图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想除了菜单项冠军溢出下拉菜单中显示的图标。

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

这篇关于如何显示在动作条上溢菜单图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆