Apple has added a tiny line over the tabBar in iOS 7 which is supposed to work as a shadow or fade between the tabBar and the UI
UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar_bg.png"];
[[UITabBar appearance] setShadowImage:tabBarBackground];
[[UITabBar appearance] setBackgroundImage:tabBarBackground];
now you can use it, with this line:
self.tabBarController.tabBar.barStyle = UIBarStyleBlack;
These code works pretty well for me (I don't really have background image for tab bar):
[tab_main.tabBar setBackgroundImage:[[UIImage alloc] init]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
And I use these code to add a frame too:
UIColor* color_green = UIColorFromRGB(0x348e5b);
tab_main.tabBar.layer.borderWidth = 0.50;
tab_main.tabBar.layer.borderColor = color_green.CGColor;
[[UITabBar appearance] setTintColor:color_green];
Hope that helps.
self.tabBarController = [[UITabBarController alloc] init];
[[[self tabBarController] tabBar] setBackgroundImage:[UIImage imageNamed:@"YOURIMAGE.png"]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
[_tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"tabtarsprnt"]]; //your custom image
[self.tabBarController.tabBar setClipsToBounds:YES];
this code also solved the my issue
Swift
Nice simple solution:
Write this below code in your custom tab bar class. Then it will hide horizontal shadow line.
self.tabBar.setValue(true, forKey: "_hidesShadow")
Objective C
[self.tabBar setValue:@(YES) forKeyPath:@"_hidesShadow"];