您的位置:首页 > 移动开发 > Cocos引擎

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)

其余地方貌似不用改
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐