如何使用苹果自定义的UITabBarItem图像?

3

苹果在“视图控制器编程指南”中提供了一个创建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;
}

然而,我是一个不懂图形设计的人,想要使用苹果内置的图标来制作选项卡栏项目。我该怎么做?有哪些可用图标及其名称的列表?


我不了解苹果图形,但是我有很多UITabBarItem图片,如果你想给我你的电子邮件地址,我会非常乐意发送给你。 - Mick Walker
1个回答

8

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接