cocos2d-x 2.14 在IOS 6.1 中竖屏设置方法如下:
看图找到 RootViewController.mm 文件
之后打开RootViewController.mm 文件,找到如下代码,并按照我写的注释修改就行了
- // Override to allow orientations other than the default portrait orientation.
- // This method is deprecated on ios6
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- //横屏用这个
- //return UIInterfaceOrientationIsLandscape( interfaceOrientation );
- //竖屏用这个
- return UIInterfaceOrientationIsPortrait(interfaceOrientation);
- }
- // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- - (NSUInteger) supportedInterfaceOrientations{
- #ifdef __IPHONE_6_0
- //横屏用这个
- //return UIInterfaceOrientationMaskLandscape;
- //竖屏用这个
- return UIInterfaceOrientationMaskPortrait;
- #endif
- }