Does Everyplay support Landscape in iOS6?

后端 未结 2 1026
醉话见心
醉话见心 2021-01-22 01:53

I\'m integrating Everyplay with my Cocos2d Game.My game only support Landscape orientation. Everything goes well on iPad. But When i test on iPhone(iOS6),it throws exception as

相关标签:
2条回答
  • 2021-01-22 02:42

    You have two options how to fix the problem.

    Option 1:

    Add UISupportedInterfaceOrientations array into your game's info.plist with items UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationPortraitUpsideDown. You can easily do this from xCode by checking all Supported Interface Orientations from your project summary page or by editing the info.plist file manually.

    Option 2:

    Add the following method to your application's AppDelegate.m file:

    // IOS 6
    
    -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
      return UIInterfaceOrientationMaskAll;
    }
    

    In both cases you must also make sure that you have added the landscape only orientation handling code to your game's main UIViewController.

    // IOS 5
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
      return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
    }
    
    // IOS 6
    
    - (BOOL)shouldAutorotate {
       return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations {
      return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
    }
    
    0 讨论(0)
  • 2021-01-22 02:45

    On iPhone Everyplay webview is always on portrait mode, but on iPad the webview supports both. Recording supports both modes as does the video player. We will likely in near future update the landscape mode for iPhone resolution too, but it will require some redesign before this task is complete.

    0 讨论(0)
提交回复
热议问题