3

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?

openfrog
  • 40,201
  • 65
  • 225
  • 373
  • I dont know about apple graphics, but I have a lot of UITabBarItem images which I would be more than happy to send you if you want to give me your email address. – Mick Walker Jan 26 '10 at 13:12

1 Answers1

8

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

Vladimir
  • 170,431
  • 36
  • 387
  • 313