子菜单布局 Android [英] SubMenu Layout Android
本文介绍了子菜单布局 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我读到 Android 中的子菜单不支持图标.我想知道这是否已经改变,或者是否有类似的方法来生成支持图标的子菜单"?
I have read that submenus in Android do not support icons. I was wondering if this has changed, or if there is a similar way to produce a "submenu" that does support icons?
目前这是我的子菜单:
这是它的 XML 文件:
Here Is the XML File For It:
<menu>
<item android:id="@+id/facebook_icon"
android:title="Share With Facebook"
android:icon="@drawable/ic_menu_facebook" />
<item android:id="@+id/twitter_icon"
android:title="Share With Twitter"
android:icon="@drawable/ic_menu_twitter" />
</menu>
我希望它看起来像这样(如果您有任何想法,我将不胜感激!):
I want it to look like this (If you have any ideas I would appreciate hearing them!):
推荐答案
您可以创建自己的对话框而不是子菜单,并使其看起来像您想要的任何方式.
You can create your own dialog instead of the submenu, and make it look any way you want.
这篇关于子菜单布局 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文