Ios 透明视图颜色从黑色变为其他颜色?

Ios 透明视图颜色从黑色变为其他颜色?,ios,xcode,swift,Ios,Xcode,Swift,我注意到,如果我将views background color设置为transparent,则在segue过渡结束后,背景颜色将变为黑色(我猜这是默认的“视口”颜色) 我能换一下吗?当然我可以把颜色从透明改成紫色,但也许有办法 这是ui窗口的默认背景色。从应用程序代理中进行设置: self.window.backgroundColor = [UIColor whiteColor]; 或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口: anyView.window.backgroundCo

我注意到,如果我将views background color设置为transparent,则在segue过渡结束后,背景颜色将变为黑色(我猜这是默认的“视口”颜色)

我能换一下吗?当然我可以把颜色从透明改成紫色,但也许有办法


这是
ui窗口的默认背景色。从应用程序代理中进行设置:

self.window.backgroundColor = [UIColor whiteColor];
或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口:

anyView.window.backgroundColor = ...

它是
ui窗口的默认背景色。从应用程序代理中进行设置:

self.window.backgroundColor = [UIColor whiteColor];
或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口:

anyView.window.backgroundColor = ...

它是
ui窗口的默认背景色。从应用程序代理中进行设置:

self.window.backgroundColor = [UIColor whiteColor];
或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口:

anyView.window.backgroundColor = ...

它是
ui窗口的默认背景色。从应用程序代理中进行设置:

self.window.backgroundColor = [UIColor whiteColor];
或者通过在任何视图控制器中查找当前屏幕上任何视图的窗口:

anyView.window.backgroundColor = ...

您应该添加以下行:

self.navigationController?.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
presentedViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
在介绍之前:

self.presentViewController(presentedViewController, animated: true, completion: nil)

您应该添加以下行:

self.navigationController?.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
presentedViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
在介绍之前:

self.presentViewController(presentedViewController, animated: true, completion: nil)

您应该添加以下行:

self.navigationController?.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
presentedViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
在介绍之前:

self.presentViewController(presentedViewController, animated: true, completion: nil)

您应该添加以下行:

self.navigationController?.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
presentedViewController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
在介绍之前:

self.presentViewController(presentedViewController, animated: true, completion: nil)


有更好的解决方案,而不是以视图控制器的形式显示,您可以在当前控制器上添加子视图。我会得到什么好处?我应该如何做到这一点?抱歉,我对Xcode很陌生:)如果你是新手,你可以尝试这里已经回答过的解决方案。有更好的解决方案,而不是以视图控制器的形式出现,你可以在当前控制器上添加子视图。我会得到什么好处,我应该如何做?抱歉,我对Xcode很陌生:)如果你是新手,你可以尝试这里已经回答过的解决方案。有更好的解决方案,而不是以视图控制器的形式出现,你可以在当前控制器上添加子视图。我会得到什么好处,我应该如何做?抱歉,我对Xcode很陌生:)如果你是新手,你可以尝试这里已经回答过的解决方案。有更好的解决方案,而不是以视图控制器的形式出现,你可以在当前控制器上添加子视图。我会得到什么好处,我应该如何做?对不起,我对Xcode很陌生:)如果你是新手,你可以试试这里已经回答过的解决方案。谢谢!这就是我想要的。在我的例子中是:
self.window?.backgroundColor=UIColor(红色:0.44,绿色:0.18,蓝色:0.33,alpha:1.00)
谢谢!这就是我想要的。在我的例子中是:
self.window?.backgroundColor=UIColor(红色:0.44,绿色:0.18,蓝色:0.33,alpha:1.00)
谢谢!这就是我想要的。在我的例子中是:
self.window?.backgroundColor=UIColor(红色:0.44,绿色:0.18,蓝色:0.33,alpha:1.00)
谢谢!这就是我想要的。在我的例子中,
self.window?.backgroundColor=UIColor(红色:0.44,绿色:0.18,蓝色:0.33,alpha:1.00)
同样有效,但在这种情况下,我想更改UIWindow的颜色。但无论如何,谢谢!在这个“琐事风格”游戏的另一个例子中,这将是有用的。这同样有效,但在这个例子中,我想改变UIWindow的颜色。但无论如何,谢谢!在这个“琐事风格”游戏的另一个例子中,这将是有用的。这同样有效,但在这个例子中,我想改变UIWindow的颜色。但无论如何,谢谢!在这个“琐事风格”游戏的另一个例子中,这将是有用的。这同样有效,但在这个例子中,我想改变UIWindow的颜色。但无论如何,谢谢!这将是有用的,在另一个情况下,在这个“琐事风格”的游戏。