Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Black flashes in iOS App Navigation Bar

So I've been getting these black flashes when I segue from one view controller to another in my app. I don't understand what causes this.

Notice the black flashes in the upper right hand corner behind the navigation bar

like image 771
Joseph Camuso Avatar asked Oct 03 '17 15:10

Joseph Camuso


2 Answers

It looks like you navigation controller's view backgroundColor is black. Either set it to your desired color, probably white:

navigationController?.view.backgroundColor = .white

or set your view controllers to extend edges, so the view of your view controller extends all the way under the navigation bar:

edgesForExtendedLayout = .all // or .top
like image 109
Au Ris Avatar answered Nov 11 '22 13:11

Au Ris


Somewhere in the view hierarchy is a view with a black background. Use the view debugger in Xcode to find it, but it could possibly be your window or the navigation controller's view.

like image 25
jrturton Avatar answered Nov 11 '22 13:11

jrturton