Customized the icons of Menu items
Hi, I would like to know how can I customized Menu icons. For instance, if the menu option is "Sa开发者_StackOverflow社区ve" I want to put custom image rather than default image. Hope it is clear. Thanks
MenuItem item;
item.setIcon(icon); // icon is Drawable icon
item.setIcon(resIcon); // resIcon is int resIcon
You will want to use the setIcon()
function of MenuItem
. It can accept either a Resource
ID or a Drawable
.
精彩评论