views:

960

answers:

2

Apple has provided an example the View Controller Programming Guide, for creating an UITabBarItem, like this:

- (id)init {
   if (self = [super initWithNibName:@"MyViewController" bundle:nil]) {
      self.title = @"My View Controller";

      UIImage* anImage = [UIImage imageNamed:@"MyViewControllerImage.png"];
      UITabBarItem* theItem = [[UITabBarItem alloc] initWithTitle:@"Home" image:anImage tag:0];
      self.tabBarItem = theItem;
      [theItem release];
   }
   return self;
}

However, I am a graphic-noob and want to use Apple's built in graphics for Tab Bar Items. How could I do that? Where is a list of the available icons and their names?

+6  A: 

Use - (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag to create UITabBarItem.
For possible UITabBarSystemItem values look in UITabBarItem class reference, 'Constants' section.

Vladimir
A: 

Ok but this method doesn't enable me to choose my title ! I would like to use an UITabBarSystemItem image with an homemade title !

How can I do that ?

Dvins