[英]Transparent View color from black to other color?
I noticed that if I set views background color to transparent, the background color turns black (which I guess is default "viewport" color) after segue transition ends. 我注意到,如果将视图背景颜色设置为透明,则在segue过渡结束后,背景颜色将变为黑色(我猜这是默认的“视口”颜色)。
Can I change that? 我可以改变吗? Of course I could just change color from transparent to purple, but maybe there is a way?
当然我可以将颜色从透明更改为紫色,但是也许有办法吗?
It's the default background color of your UIWindow
. 这是
UIWindow
的默认背景色。 Either set it from your app delegate : 从您的应用程序委托中设置:
self.window.backgroundColor = [UIColor whiteColor];
or by looking up the window of any view currently on-screen, in any view controller: 或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口:
anyView.window.backgroundColor = ...
You should add this line: 您应该添加以下行:
self.navigationController?.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
presentedViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
Before presenting: 介绍之前:
self.presentViewController(presentedViewController, animated: true, completion: nil)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.