开发者

How to set tab-bar image

开发者 https://www.devze.com 2023-03-17 08:57 出处:网络
I have a tab bar in my application and that how I am customizing it home_view_controleller * home_controller =[[[home_view_controleller alloc]init] autorelease];

I have a tab bar in my application and that how I am customizing it

home_view_controleller * home_controller =  [[[home_view_controleller alloc]init] autorelease];
NSArray *viewControllers = [NSArray arrayWithObjects:h开发者_JS百科ome_controller, detailController2, detailController3,detailController4,detailController5,nil];
[tabBarController1 setViewControllers:viewControllers animated:YES];

as home_controller extend UIViewController. How I can set its tabBarItem.image before adding it to viewControllers array?


You should set the view controller's tabBarItem.

home_controller.tabBarItem = [[[UITabBarItem alloc] initWithTitle:myTitle image:myImage tag:myTag] autorelease];
0

精彩评论

暂无评论...
验证码 换一张
取 消