2

I want to change the color of UITabBar. I used UITabBar by the help of InterfaceBuilder but it doesn't provide the option to change the color of tabbar I want to change by tabBar color to Blue color can any one suggest me the best way of doing this work.

Thanks in adavance.

Fry
  • 6,235
  • 8
  • 54
  • 93
user755278
  • 1,634
  • 3
  • 16
  • 32
  • 1
    You can also have readymade sample available from iDevRecipes here https://github.com/boctor/idev-recipes. – Janak Nirmal Jun 03 '11 at 04:56
  • Duplicate question of http://stackoverflow.com/q/675433/777498 and http://stackoverflow.com/q/571028/777498 – Chanok Jun 03 '11 at 04:03

2 Answers2

0

Try this:

UITabBarController *tabBarC = [[UITabBarController alloc] init];

if ([[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending) {
    tabBarC.tabBar.selectedImageTintColor = [UIColor redColor];
}

Remember, only with iOS5+.

Fry
  • 6,235
  • 8
  • 54
  • 93
0

The UITabBar does not have a backgroundColor nor tintColor property. You can however use graphics to change the appearance of the UITabBar. Check out iDevRecipes tutorials on how to customize UITabBars.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186