I implemented a custom UITabBar and I still have this gradient/shadow on top of it. I added
[self.tabBar setBackgroundImage:[UIImage imageNamed:@\"navBarBotto
Try setting a 1x1 pixel transparent shadow image for the UITabBar:
[[UITabBar appearance] setShadowImage:[UIImage imageNamed:@"transparentShadow.png"]];
This code works both iOS 13 and below
if #available(iOS 13, *) {
let appearance = self.tabBar.standardAppearance.copy()
appearance.backgroundImage = UIImage()
appearance.shadowImage = UIImage()
appearance.shadowColor = .clear
self.tabBar.standardAppearance = appearance
} else {
self.tabBar.backgroundImage = UIImage()
self.tabBar.shadowImage = UIImage()
}
Just be setting image it will not remove the shadow line you have to set it's borderWidth to 0. here is the code
[[UITabBar appearance] setShadowImage:[UIImage new]];
[UITabBar appearance].layer.borderWidth = 0.0f;
[UITabBar appearance].clipsToBounds = true;
I have achieved the same look by following method.
1. Set the background bar tint colour to same as the main parent view background colour.
2.
this.TabBar.BarStyle = UIBarStyle.BlackOpaque;
I used it in Xamarin, Please verify the Swift syntax.
Swift 4
UITabBar.appearance().layer.borderWidth = 0.0
UITabBar.appearance().clipsToBounds = true
In iOS 7 - this works:
[self.actionToolbar setShadowImage:[[UIImage alloc] init] forToolbarPosition:UIBarPositionAny];
[self.actionToolbar setBackgroundImage:[[UIImage alloc] init] forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
Hope that helps someone.