当视图方向更改旋转的黑色背景 [英] Black background when view rotates on orientation change

查看:204
本文介绍了当视图方向更改旋转的黑色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在X code。将方向改变响应应用摆弄,我试图找出如何我可以改变我的非黑色的观点似乎对方向变化的黑色背景旋转!

I am fiddling with an orientation change responsive app in Xcode and am trying to figure out how I can change that my non-black view seems to rotate on a black background on orientation change!

这看起来是这样的:

我想黑色背景改变我的看法的颜色 - 这是在描绘的情况下粉红

I would like to change the black background to the colour of my view - which is pink in the depicted case.

在我的应用程序启动也显示黑屏,直到出现实际的看法。我有,这是,在方向变化变得可见同样的黑色的感觉?

When my app launches it also shows a black screen until the actual view appears. I have the feeling that it is the same black that becomes visible on orientation change?

我曾试图改变我的应用程序委托的那样,精推法窗口的背景颜色,但没有任何效果:

I have tried to change the background colour of the window in the did-finish-launching method of my app delegate, but that did not have any effect:

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window.backgroundColor = [UIColor purpleColor];

    ...
}

有什么建议?

推荐答案

尝试使用 willAnimateRotationToInterfaceOrientation:时间:方法,而不是 willRotateToInterfaceOrientation:时间:

Try using willAnimateRotationToInterfaceOrientation:duration: method instead of willRotateToInterfaceOrientation:duration:

但是,我认为,几乎所有在iOS中应用程序的显示黑色背景的一瞥,似乎正常。在如果是很长一段时间的情况下,尽量减少持续时间。

But I think nearly all of the apps in iOS show a glimpse of black background, it seems normal. In your case if it is for long time, try reducing the duration time.

另外,请查阅此邮政#1

这篇关于当视图方向更改旋转的黑色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆