3

Apple 提供了一个示例 View Controller Programming Guide,用于创建 UITabBarItem,如下所示:

- (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;
}

但是,我是一个图形菜鸟,想使用 Apple 的内置图形来制作标签栏项目。我怎么能那样做?可用图标及其名称的列表在哪里?

4

1 回答 1

8

用于- (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag创建 UITabBarItem。
对于可能的 UITabBarSystemItem 值,请查看 UITabBarItem 类参考“常量”部分。

于 2010-01-26T13:11:49.037 回答