0

In my application, I am using a UITabBarController. However, i need to customise the appearance of my UITabBarItems.

At present, my screen looks like this:

enter image description here

I would like to increase the distance between the tabs, and the middle tab has bigger text, due to which the tab looks very crowded. Also, i would like to add a separator between the tabs.

Here's the code:

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"]];
Shradha
  • 991
  • 3
  • 13
  • 38

1 Answers1

0

Set tabBarItem such like

UITabBarItem* ClientSupportTabBarItem = [[UITabBarItem alloc] init];
[ClientSupportTabBarItem  setFinishedSelectedImage: [UIImage imageNamed: @"btnTabItem-active.png"] withFinishedUnselectedImage: [UIImage imageNamed: @"btnTabItemNormal.png"]];
ClientSupportTabBarItem.title = @"Inquiry";
[customerCareNavController setTabBarItem: ClientSupportTabBarItem];
iPatel
  • 46,010
  • 16
  • 115
  • 137
  • how to change the font size and font family of the title??? and how to add separator in the tabs? – Shradha Jan 30 '14 at 09:07
  • http://stackoverflow.com/questions/11069437/changing-font-in-uitabbaritem and to add separator in the tabs, i thinks your meed to create image of UITabBarItem.. – iPatel Jan 30 '14 at 09:11
  • For set font also check ..http://stackoverflow.com/questions/2576592/changing-font-size-of-tabbaritem – iPatel Jan 30 '14 at 09:13