1

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.

W.S
  • 931
  • 1
  • 10
  • 36

2 Answers2

4

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

[[UITabBar appearance] setSelectionIndicatorImage:[[UIImage alloc] init]];
Daniel Nord
  • 535
  • 5
  • 10
  • Thanks a bunch Daniel! yes you are right! Basically i was not setting selectionIndicatorImage before that's why shadow was there. [[UITabBar appearance] setSelectionIndicatorImage was the line which i was missing. – W.S Nov 26 '12 at 08:08
2

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.

Limaaf
  • 3,296
  • 3
  • 18
  • 17