Search code examples
iosuitabbar

UITabBar showing all icon as "selected" mode when application started


I got a strange problem which I tried to resolve for hours but no luck. I have successfully loaded tab bar icon images via IB. However, all the icons are showing "coloured" at the same time when application first loaded instead of only the active tab coloured (see image below). tab bar appearance when application first loaded

However the text is correctly shown (only left most tab is coloured). Any idea would be greatly appreciated..


Solution

  • Okay, it's because I've set the UIView's global tint color in the AppDelegate which override the TabbarController's behaviour:

    [[UIView appearance] setTintColor:[UIColor colorWithRed:252.0f/255.0f green:99.0f/255.0f blue:61.0f/255.0f alpha:1.0]];
    

    If you set it in the AppDelegate it will override all your color setting.