简体   繁体   中英

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.

请注意导航栏后面右上角的黑色闪烁

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM