【问题标题】:Cocos2d 3.0 Set Portrait orientationCocos2d 3.0 设置纵向
【发布时间】:2014-07-07 23:58:58
【问题描述】:

已经在 AppDelegate.m 中添加了下面的代码,但仍然无法正常工作。

-(NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskPortrait;

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

这里是 Xcode 总结页面:

【问题讨论】:

    标签: cocos2d-iphone


    【解决方案1】:

    找到解决方案。我们可以在 setupCocos2dWithOptions 中设置方向。

    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        [self setupCocos2dWithOptions:@{
            CCSetupShowDebugStats: @(YES),
            CCSetupScreenOrientation: CCScreenOrientationPortrait,
        }];
    
        return YES;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多