IOS 7 uitabbar shows invisible on ios8

I have a pre-existing application (pre ios8) that uses UITabbar. The tabba is visible in the simulator and ios7 device, but in ios8 it is invisible. What causes this problem? there is space for the tab bar, but its background and text / images are missing. I attached it.

iOS 7 :

enter image description here

iOS 8 :

ios 8

+5
source share
1 answer

Even if setFinishedSelectedImage:withFinishedUnselectedImage: deprecated in iOS7, it works fine in iOS7, but not in 8.

Use the image and selectedImage property of the UITabBarItem instead.

I also had the same problem, but my problem was different.

Link Code:

  UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; if ([self iOS7OrAbove]) { //use UIImageRenderingModeAlwaysOriginal to set the custom image for ios 7 and above. tabBarItem1.selectedImage = [[UIImage imageNamed:@"SelectedImage"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; tabBarItem1.image = [[UIImage imageNamed:@"UnselectedImage"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; } else { [tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"SelectedImage"] withFinishedUnselectedImage:[UIImage imageNamed:@"UnselectedImage"]]; } 
+2
source

Source: https://habr.com/ru/post/1203097/


All Articles