public boolean onCreateOptionsMEnu(Menu m) { SubMenu s1 = m.addSubMenu("menu1"); s1.add(0,1,"1").setIcon(R.drawable.icon1); s1.add(0,2,"2").setIcon(R.drawable.icon2); return super.onCreateOptionsMenu(m);}解决方法 子菜单不支持图标.
https://developer.android.com/guide/topics/ui/menus.html:
总结Icon Menu This is the collection of items initially visible at the bottom of the screen at the press of the MENU key. It supports a maximum of six menu items. THESE ARE the only menu items that support icons and the only menu items that do not support checkBoxes or radio buttons.
以上是内存溢出为你收集整理的android – 添加带子菜单项的图标全部内容,希望文章能够帮你解决android – 添加带子菜单项的图标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)