I made a custom tab bar with one of them extending beyond the bar. There is a line overlapping the center tab bar. Is there anyway I can get rid or this or hide it?
To do it, I just set tab bar images:
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];
tabBarItem1.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);
tabBarItem3.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"scheduleTabBarImageSel.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"scheduleTabBarImage.png"]];
[tabBarItem3 setFinishedSelectedImage:[UIImage imageNamed:@"favoritesTabBarImageSel.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"favoritesTabBarImage.png"]];
[tabBarItem2 setFinishedSelectedImage:[UIImage imageNamed:@"searchTabBarImageSel.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"searchTabBarImage.png"]];
Any idea how to hide the line? Thanks
If I'm understanding your correctly, the problem is with the 1-2ish pixel shadow sitting on top of the tab bar. If this is the case, you can remove the shadow the same way you would with a navigation bar. Simply enable clips to bounds.
[self.tabBarController.tabBar setClipsToBounds:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With