Search code examples
iphoneiosuitabbar

get rid of white strip across UITabBar


I am have researched this and still cant figure out what the proper word for the white gloss strip across UITabBar. I have googled so much on how to remove this gloss and couldn't find anything. For a reference to what I am talking about, see this Image:

Image of TabBar

I really hope I am missing something simple here and am not over thinking this...

Thank you in advance for any help whatsoever.


Solution

  • See if any of this code helps you. This can all be found in Apple Docs. http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBar_Class/Reference/Reference.html

    // custom icons
    UITabBarItem *item = [[UITabBarItem alloc] init];
    item.title = @"foo";
    // setting custom images prevents the OS from applying a tint color
    [item setFinishedSelectedImage:[UIImage imageNamed:@"tab1_active.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab1_image_deselected.png"]];
    tab1ViewController.tabBarItem = item;
    
    // tab bar
    
    // set background image - will be used instead of glossy black
    tabBarController.tabBar.backgroundImage = [UIImage imageNamed:@"tab_bar_bg.png"];
    // optionally set the tint color - setting this ti nil will result in the standard, blue tint color. tint color is ignored when custom icons are set as above.
    tabBarController.tabBar.selectedImageTintColor = nil;
    // remove the highlight around the selected tab - or provide an alternate highlight image. If you don't do this the iOS default is to draw a highlighted box beneath the selected tab icon.
    tabBarController.tabBar.selectionIndicatorImage = [[UIImage alloc] init];