开发者

android submenu header icon

开发者 https://www.devze.com 2023-04-09 09:19 出处:网络
I\'m new to Android. I\'m learning to make menu and submenu now but stumbled upon a problem. I want to change the submenu header icon in the xml but don\'t know how to.

I'm new to Android.

I'm learning to make menu and submenu now but stumbled upon a problem.

I want to change the submenu header icon in the xml but don't know how to.

I tried to change the header icon programatically but there's no method to get the submenu(only add submenu).

Is it possible to change the header icon in the xml? I saw codes that add submenu programatically and change the header 开发者_运维知识库there. Is it weird to make the submenu in the xml?

Thanks.

edit: why I cannot type 'Hi' at the first sentence?


MenuItem newSubMenu = mainMenu.add("SubMenu");
newSubMenu.method....
0

精彩评论

暂无评论...
验证码 换一张
取 消