2012-07-12 29 views
1

enter image description here如何自定义我的Tabbar控制器图标(背景图像)?

我有,我想表明我自己的图片作为使用TabBar icons.but现在只有默认greyone是coming.i需要将其更改为我自己的图像的iPhone应用程序?。我经历很多链接,但没有什么似乎很清楚。有谁可以知道如何实现这一目标?

+0

把图片如何ü希望它 – Saad 2012-07-12 11:52:59

+0

@TheSaad编辑我的问题请看到了吗? – hacker 2012-07-12 11:58:57

+0

你在说这个 objMoreTabController.tabBarItem.image = [UIImage imageNamed:@“moreTabImage”]; – Saad 2012-07-12 12:13:12

回答

1

请从here下载源代码并根据您的需求更改图片。

+0

我想要用我的UItabbar控制器来实现这个目标? – hacker 2012-07-12 12:24:43

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; 

也看到这个链接 - click me