Search code examples
ios5uitabbarcontrolleruitabbaruitabbaritem

How to hide white shadow of tabbar from selected item


is there any way to hide shadow color of UITabBar from it's selected items.

for some reason i'm assigning different background images to tabbar on the basis of selected tab index rather than assigning image to individual tab. there is white shadow behind the selected tab. can we disable or remove this shadow?

enter image description here

Thanks.


Solution

  • For iOS 5+

    In AppDelegate set something like:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        [[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"transparent_image.png"]];
    
        return YES;
    }
    

    where transparent_image.png is a full transparent image =)

    Don´t know if this is the best approach since I recently started with iOS, but think this can help you.