简体   繁体   English

iOS应用程序导航栏中的黑色闪烁

[英]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. 看起来你的导航控制器的视图backgroundColor是黑色的。 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. 使用Xcode中的视图调试器来查找它,但它可能是您的窗口或导航控制器的视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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