How to change Background color of UITabbar selected tab color to blue?

12,918

use the tintColor: property of UITabBar:

myTabBarController.tabBar.tintColor = [UIColor blueColor];

note this only works on iOS5.

EDIT:

oops! sorry i misunderstood your question. I thought you meant the background color of the whole tab bar.

For that you can add an image for background of the selection using selectionIndicatorImage property:

myTabBarController.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"myImage.png"];

hope this helps

Share:
12,918
Ankit Vyas
Author by

Ankit Vyas

I am a Computer Engineer and Working as an iphone application Developer.

Updated on June 23, 2022

Comments

  • Ankit Vyas
    Ankit Vyas almost 2 years

    enter image description here

    Hi, I wanted this kind of Tab Selection effect. Instead of Black Background it should be blue one.Is it possible that when i select any tab it should come up with blue background.Please guide me what should i do?I have tried so much but not getting any proper solution.Please suggest me what should i do?

  • Jamal Zafar
    Jamal Zafar almost 12 years
    @KDaker- what if I want to change the background icon of the whole tab item at selection?