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" //横版
找到项目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" //横版
相关文章推荐
- Cocos2d-x中背景音乐和音效使用实例
- Cocos2d-x学习笔记之CCScene、CCLayer、CCSprite的默认坐标和默认锚点实验
- Cocos2d-x UI开发之CCControlPotentiometer控件类使用实例
- Cocos2d-x UI开发之文本类使用实例
- Cocos2d-x保存用户游戏数据之XML文件是否存在问题判断方法
- Cocos2d-x UI开发之菜单类使用实例
- Cocos2d-x UI开发之CCControlButton控件类实例
- Cocos2d-x学习笔记之世界坐标系、本地坐标系、opengl坐标系、屏幕坐标系
- Cocos2d-x UI开发之CCControlColourPicker控件类使用实例
- Cocos2d-x学习笔记之CCLayerColor层的使用实例
- Cocos2d-x Schedule定时器的使用实例
- Cocos2d-x中使用CCScrollView来实现关卡选择实例
- Cocos2d-x中CCEditBox文本输入框的使用实例
- cocos2d-x学习笔记之CCLayer、CCLayerColor、CCLayerGradient、CCLayerMultiplex场景层介绍
- Cocos2d-x UI开发之CCControlSlider控件类使用实例
- Cocos2d-x学习笔记之开发环境搭建
- Cocos2d-x学习笔记之Hello World!
- Cocos2d-x的内存管理总结
- Cocos2d-x 3.0中集成社交分享ShareSDK的详细步骤和常见问题解决
- Cocos2d-x入门教程(详细的实例和讲解)