我的工程支持画中画,需要支持multitasking,按照Apple的要求需要在工程info.plist中支持四个方向的旋转,同时还需要launchscreen.storyboard(之前我用的是images.xcassets).
我的APP在运行中只支持横屏,希望启动图也只有横屏。所以,我设置launchScreen.storyboard为landscape模式。
结果,ipad竖屏时候,启动图是竖屏的。也就是说,虽然launchScreen.storyboard设置了横屏,但是,没有效果。
有没有办法,在info.plist设置了四个方向的旋转后,仍让启动图强制横屏?

解决方案 »

  1.   

    在application:didFinishLaunchingWithOptions:  中添加可以解决:
        /*目前只有启动图是支持横竖屏,需要强行设置为landscape*/
        if(UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)){
            [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
        }
      /*解决横竖屏问题,在iOS8,9上显示半屏,然后再转一下*/
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
            self.window.rootViewController.view.frame = CGRectMake(0, 0, 1024, 768);
        }