我的应用程序中有一个标签栏,以及我如何自定义它
home_view_controleller * home_controller = [[[home_view_controleller alloc]init] autorelease];
NSArray *viewControllers = [NSArray arrayWithObjects:home_controller, detailController2, detailController3,detailController4,detailController5,nil];
[tabBarController1 setViewControllers:viewControllers animated:YES];
home_controller
延长UIViewController
。如何在将tabBarItem.image
添加到viewControllers
数组之前将其设置为{{1}}?
答案 0 :(得分:1)
您应该设置视图控制器的tabBarItem
。
home_controller.tabBarItem = [[[UITabBarItem alloc] initWithTitle:myTitle image:myImage tag:myTag] autorelease];