cocos2d-x在Xcode(iOS )中设置横竖屏的解决方案
2013-03-25 18:53
204 查看
在
RootViewController.mm文件里找到 - (NSUInteger) supportedInterfaceOrientations方法。如果想让程序是竖屏,直接return
UIInterfaceOrientationMaskPortrait。横屏是默认的,当然也可以选择别的,自己跟到源码里找,应该不难。
大概是以下几个
UIInterfaceOrientationMaskPortrait = (1 <<
UIInterfaceOrientationPortrait),
UIInterfaceOrientationMaskLandscapeLeft = (1 <<
UIInterfaceOrientationLandscapeLeft),
UIInterfaceOrientationMaskLandscapeRight = (1 <<
UIInterfaceOrientationLandscapeRight),
UIInterfaceOrientationMaskPortraitUpsideDown = (1 <<
UIInterfaceOrientationPortraitUpsideDown),
UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight),
UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight |
UIInterfaceOrientationMaskPortraitUpsideDown),
UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
其余地方貌似不用改
RootViewController.mm文件里找到 - (NSUInteger) supportedInterfaceOrientations方法。如果想让程序是竖屏,直接return
UIInterfaceOrientationMaskPortrait。横屏是默认的,当然也可以选择别的,自己跟到源码里找,应该不难。
大概是以下几个
UIInterfaceOrientationMaskPortrait = (1 <<
UIInterfaceOrientationPortrait),
UIInterfaceOrientationMaskLandscapeLeft = (1 <<
UIInterfaceOrientationLandscapeLeft),
UIInterfaceOrientationMaskLandscapeRight = (1 <<
UIInterfaceOrientationLandscapeRight),
UIInterfaceOrientationMaskPortraitUpsideDown = (1 <<
UIInterfaceOrientationPortraitUpsideDown),
UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight),
UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight |
UIInterfaceOrientationMaskPortraitUpsideDown),
UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
其余地方貌似不用改
相关文章推荐
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- cocos2d 在ios上设置横竖屏
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- 【iOS-Cocos2d游戏开发】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d开发之三】CCScene切换的所有特效,以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(27种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- 【iOS-Cocos2d游戏开发之三】CCScene切换的所有特效(28种)以及设置屏幕横竖屏!
- XCODE 4.5 IOS多语言设置
- 【Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏
- [iOS]设置Xcode 4同时支持旧版iOS设备(armv6),并兼容iPhone和iPad
- ios或者cocos2d-x开发在Xcode编译时自适应失效,获取屏幕尺寸不准确
- 【iOS-Cocos2d游戏开发之七】在cocos2d中添加/删除系统组件,并解决View设置透明会影响View中的其他组件的问题!【11月28日更新解决添加组件Cocos2d动画停止播放的BUG】