在旋转时更改app后面的颜色 [英] Change color behind app on rotation
问题描述
当iOS应用程序旋转时,当应用程序位于纵向和横向之间时,它将显示黑色背景。是否可以将此颜色从默认的黑色更改为白色?更改UIWindow的背景颜色无济于事。以下是Safari中旋转期间黑色背景的示例:
When an iOS app rotates it will reveal a black background when the app is between portrait and landscape. Is it possible to change this color from the default black to white? Changing the UIWindow's background color will not help. Here is an example of the black background in Safari during rotation:
推荐答案
我做了类似的事情,但我现在找不到来源,但这里的想法是:
I have done something similar but I couldn't find the source now, but here is the idea:
创建并添加一个大得多的视图作为后备视图并居中。
Create and add a significantly larger view as backing view and center it.
添加 UIWebView
作为背景为白色的大视图的子视图。
Add the UIWebView
as subview of this large view whose background is white.
重新定位 UIWebView
的中心。
这篇关于在旋转时更改app后面的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!