W.S
W.S

Reputation: 931

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.

Upvotes: 1

Views: 1797

Answers (2)

Daniel Nord
Daniel Nord

Reputation: 565

You don't need to create a transparent image. This is all you need:

[[UITabBar appearance] setSelectionIndicatorImage:[[UIImage alloc] init]];

Upvotes: 4

Limaaf
Limaaf

Reputation: 3436

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.

Upvotes: 2

Related Questions