苹果已经提供了一种示例的视图控制器编程指南用于创建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;
}

不过,我是一个图形,小白并希望使用苹果公司的内置图形标签栏项目。我怎么能这样做?哪里是可用图标及其名称的列表?

有帮助吗?

解决方案

使用- (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag创建UITabBarItem。结果 对于可能UITabBarSystemItem值看起来在UITabBarItem类引用,“常数”部分。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top