【发布时间】:2019-09-13 20:49:02
【问题描述】:
我有一个 iPad 应用程序,我在该应用程序的开头创建了一个新的UIWindow,并在我进行一些资源同步时显示它。当 iPad 处于纵向时启动应用程序时,一切都很好。然而,在横向时,新创建的UIWindow's 大小看起来不错,但它看起来是横向的,而且它的坐标看起来很奇怪。以下是纵向和横向的屏幕截图:
风景一是向右旋转一次得到的。
我创建并显示UIWindow 的代码如下:
UIWindow *window=[UIApplication sharedApplication].keyWindow;
self.progressWindow = [[UIWindow alloc] initWithFrame:window.frame];
self.progressWindow.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.5f];
self.progressWindow.windowLevel = UIWindowLevelAlert;
/* some other code to create the subviews */
[self.progressWindow makeKeyAndVisible];
此问题仅在 iOS 8 上出现。
【问题讨论】: