Delete row in custom tab bar

I created a special tab bar, one of which goes beyond the bar. There is a line overlapping the panel of the main tabs. Anyway, can I get rid of this or hide it?

enter image description here

To do this, I just set the images in a tab:

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

+7
ios objective-c customization line uitabbar
source share
2 answers

It seemed to work for me:

  [[UITabBar appearance] setBackgroundImage:[[UIImage alloc] init]]; 
0
source share

If I understand your problem correctly, the problem is that 1-2ish shadows sit on top of the tab bar. If so, you can remove the shadow in the same way as with the navigation bar. Just include clips in frames.

 [self.tabBarController.tabBar setClipsToBounds:YES]; 
+6
source share

All Articles