Icons in tabs and menu

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Icons in tabs and menu

Postby atrus123 » Wed Oct 22, 2008 7:01 am

How does one go about adding icons to tabs and menu items?

Sorry if this has been discussed before; I did a search but was unable to find anything.
atrus123
Developer
Developer
 
Posts: 26
Joined: Thu Oct 09, 2008 2:16 am
Location: Annapolis, MD

Top

Postby MrSnowflake » Wed Oct 22, 2008 10:38 am

I can only say this about the menu, but when you do:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. menu.addItem(0, 0, 0, "MenuItem");
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

It returns a MenuItem object. Use this to set an icon.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. MenuItem item = menu.addItem(0, 0, 0, "MenuItem");
  2.  
  3. item.setIcon();
  4.  
  5.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


For such questions there's documentation, if you looked at the Menu.addItem() you'd see there's a MenuItem returned!
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby atrus123 » Wed Oct 22, 2008 12:34 pm

MrSnowflake wrote:I can only say this about the menu, but when you do:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. menu.addItem(0, 0, 0, "MenuItem");
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

It returns a MenuItem object. Use this to set an icon.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. MenuItem item = menu.addItem(0, 0, 0, "MenuItem");
  2. item.setIcon();
  3.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


For such questions there's documentation, if you looked at the Menu.addItem() you'd see there's a MenuItem returned!

Thank you for your help.

Sorry about missing that in the documentation. I did look... must have just missed it. (It was late and I was posting more out of frustration.)
atrus123
Developer
Developer
 
Posts: 26
Joined: Thu Oct 09, 2008 2:16 am
Location: Annapolis, MD

Postby atrus123 » Wed Oct 22, 2008 6:11 pm

I believe I figured out the tab issue, and it looks like it's just as simple setting a view id to the setContent function. I'll try it this evening and post the code here if it works.
atrus123
Developer
Developer
 
Posts: 26
Joined: Thu Oct 09, 2008 2:16 am
Location: Annapolis, MD

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests