如何设置标签栏图像

时间:2011-07-04 16:18:48

标签: ios4 uitabbarcontroller

我的应用程序中有一个标签栏,以及我如何自定义它

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}}?

1 个答案:

答案 0 :(得分:1)

您应该设置视图控制器的tabBarItem

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