Dev
Dev

Reputation: 199

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 "Save" I want to put custom image rather than default image. Hope it is clear. Thanks

Upvotes: 1

Views: 462

Answers (2)

Mohit Verma
Mohit Verma

Reputation: 3025

MenuItem item;
        item.setIcon(icon);            // icon is Drawable icon
        item.setIcon(resIcon);         // resIcon is int resIcon

Upvotes: 1

Will Tate
Will Tate

Reputation: 33509

You will want to use the setIcon() function of MenuItem. It can accept either a Resource ID or a Drawable.

Upvotes: 0

Related Questions