1

在此处输入图像描述

我有一个 iphone 应用程序,我想在其中将我自己的图像显示为标签栏图标。但现在只有默认的 grayone 来了。我需要将其更改为我自己的图像?我浏览了很多链接,但似乎什么也没有非常清楚。有人可以知道如何实现这一目标吗?

4

2 回答 2

1

请从这里下载源代码并根据您的要求更改图像。

于 2012-07-12T12:06:18.927 回答
0

您可以像这样在 tabBarItem 上设置图像:-

tabBarController = [[UITabBarController alloc] init];
tabBarController.delegate = self;
ViewController *viewObject= [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController *navView = [[UINavigationController alloc] initWithRootViewController: viewObject];
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Tutorial" image:[UIImage imageNamed:@"kb-emoji-U+E031.png"] tag:1];
navView.tabBarItem = tabBarItem;
tabBarController.viewControllers = [NSArray arrayWithObjects:navView,nil];
self.window.rootViewController = tabBarController;

另请参阅此链接 -点击我

于 2012-07-12T12:40:05.533 回答