The navigation bar for a split view controller is darker when inside the tab bar controller

If you place the split view controller inside the tab bar controller, the navigation bar and tab bar are darker on the left. I attached a screenshot. I created this by creating a Master-Detail application and then adding a tab bar controller. How do you fix this problem?

enter image description here

+6
source share
2 answers

At the time of writing (May 2017), this error still exists. I cannot believe that Apple will not take care of this. Worse, if you rotate your device, open the wizard on the side and turn it back, the translucent bars switch, and the wizard has a working translucent rod, but no details.: /

The only possible fix I could come up with was to get rid of the UITabBarController and instead create my own implementation of the tab bar controller using a simple UIViewController with a UITabBar at the bottom and the UIViewController API.

This means a lot of coding to reinvent the wheel. It’s sad not to use the UITabBarController, but it’s like. You have to compromise between the container controller and all its good features, such as the "More" controller, which you get for free, and with translucent bars.

If you can live without translucent bars, I will still go for the UITabBarController for all the coding. On the other hand, you can replace the UITabBar with a UICollectionView and have more than 6 elements without requiring a “controller” at all.

+3
source

Set the backgroundColor to white for the navigation controller:

self.navigationController?.view.backgroundColor = UIColor.whiteColor() 

This will retain a light gray color.

You can also turn off transparency, but then the navigation bar will be white:

 self.navigationController?.navigationBar.translucent = false 

Answers from this stack overflow question: Dark shadow on the navigation bar during segue transition after upgrading to Xcode 5.1 and iOS 7.1

0
source

All Articles