iPhone应用程序自定义UIWindow错误框架在iPad横向方向

时间:2014-10-31 09:45:23

标签: ios iphone ios8 landscape uiwindow

我正在使用自定义UIWindow编写iPhone应用程序。(xCode6.1,iOS8.1)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
    // Override point for customization after application launch.
    application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;
    CGRect bounds = [[UIScreen mainScreen] bounds];
    _window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, bounds.size.height, bounds.size.width)];
    [_window setBackgroundColor:[UIColor greenColor]];
    [_window makeKeyAndVisible];
    return YES;
}

它仅针对iPhone,仅限景观。所有iPhone设备都可以正常工作,但是当它在iPad上运行时,UIWindow框架就会崩溃。

enter image description here

有什么建议吗?

0 个答案:

没有答案