IOS 11 Prefers LargeTitles Weird Transition

So, I had a strange problem with the new big headers in iOS 11. Instead of trying poorly and vaguely to explain that the problem is here, this is a 10-second screen recording of what is happening:

YouTube Question Screen Recording

As you can see, there is a strange black bar that appears during the transition between the view controller, which has

navigationItem.largeTitleDisplayMode = .never 

And the one that is installed on .always

Thanks in advance!

+5
source share
2 answers

Before proceeding, install this:

 self.navigationController?.view.backgroundColor = .white 
+11
source

As Pranav said, the problem here is the background color for representing the navigation controller, however changing this from the child view controller is not an ideal way to do this.

Instead, it is better to use a subclass of UINavigationController, and viewDidLoad() to

 override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white } 

Then just use your own subclass, not the standard UINavigationController. Thus, you only need this code in one place.

0
source

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


All Articles