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

cocos2d-x如何切换横竖屏

2015-09-07 17:51 489 查看
IOS:

找到项目IOS/RootViewController.mm

修改 - (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//横版
//return UIInterfaceOrientationMaskAllButUpsideDown;
//竖版
return UIInterfaceOrientationMaskPortrait;
#endif
}我将原来的横版改成了竖版

另外我们需要改一下项目,点击你的项目,选择General选项。修改Device Orientation 

其中 portrait //竖版

landscape //横版,横版需要left和right都勾选


搞定IOS版本

android:

android比较简单,直接修改项目proj.android/AndroidManifest.xml

android:screenOrientation="portrait" //竖版

android:screenOrientation = "landscape" //横版
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息