开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜