I have a problem with the new navigation bar for iOS 11.
In root view set new navigation by code:
if (@available(iOS 11.0, *)) {
self.navigationController.navigationBar.prefersLargeTitles = YES;
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
}
Then from root view, I pushed to another view and set code navigation bar by
if (@available(iOS 11.0, *)) {
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
}
It works well. However, when push and pop view a black color appeared like the image below:
I don't know why the black color appeared on this view although I did not set back ground for navigation bar is a black color for the whole screen in my app.
Someone have any idea for the problem. Please drop me some suggestion to solve that bug. Thanks.
I solved this issue by setting navigation controller background colour in the UIViewController class where I am getting black colour.
Here is the code I used :
navigationController?.view.backgroundColor = UIColor.white
I have tried changing background colours and shadows in story board but it doesn't seem to fix this issue. Hopefully this answer is still relevant here.