我正在使用cocos2d-x 2.2.3在xcode中开发游戏。我想将模式从横向更改为纵向。我在rootviewcontroller.mm文件中使用了以下代码。但它仍然不起作用。请任何人都可以帮助我。谢谢
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
答案 0 :(得分:0)
在Rootviewcontroller.mm类中,将代码更改为以下内容。
- (void)didFinishBannerViewActionNotification:(NSNotification *)notification
{
NSLog(@"didFinishBannerViewActionNotification");
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskPortrait;
#endif
}
并在xcode中单击您的项目名称,在常规类别中将“设备方向”更改为“纵向”。我希望它能奏效。