문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top