【发布时间】:2014-01-30 08:57:44
【问题描述】:
在我的应用程序中,我使用的是UITabBarController。但是,我需要自定义 UITabBarItems 的外观。
目前我的屏幕是这样的:
我想增加标签之间的距离,中间的标签有更大的文字,因此标签看起来很拥挤。另外,我想在标签之间添加一个分隔符。
代码如下:
customerCareNavController = [[UINavigationController alloc] initWithRootViewController:custCareVC];
customerCareNavController.title = @"Inquiry";
purchaseOrderNavController = [[UINavigationController alloc] initWithRootViewController:POController];
purchaseOrderNavController.title = @"Purchase Order";
accAndContactsNavController = [[UINavigationController alloc] initWithRootViewController:accAndContactsController];
accAndContactsNavController.title = @"Accounts And Contacts";
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:customerCareNavController,accAndContactsNavController,purchaseOrderNavController, nil];
[(UITabBarItem*)[tabBarController.tabBar.items objectAtIndex:0] setImage:[UIImage imageNamed:@"Customer_Service.png"]];
[(UITabBarItem*)[tabBarController.tabBar.items objectAtIndex:1] setImage:[UIImage imageNamed:@"Acc_Cont.png"]];
[(UITabBarItem*)[tabBarController.tabBar.items objectAtIndex:2] setImage:[UIImage imageNamed:@"PO.png"]];
【问题讨论】: