quickcocos2dx xcode 6.3 中项目横屏设置
2015-07-08 19:43
519 查看
今天在捣鼓项目的时候发现,xcode6.3版本中的横屏设置并不是在项目的
TARGET->General->Deployment Info->Device Orientation中进行勾选就完事了
必须修改代码
首先,以上的部分必须选择
Landscape Left
Landscape Right
这2个选项
若仅仅如此,直接编译通过。再运行,则会出现app crash的情况,而且输出以下提示
** Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’,reseason:’Supported orientations has no common orientation with the application, and shouldAutoroate is returning YES’
然后输出一些traceback的东西
解决方法
在AppController.mm中编写以下接口
OK,crash 的问题到此为止解决了
接下来编译运行,还是竖屏的,原因在于RootViewController.mm中所有的接口都是返回的竖屏,只要修改以后2个接口就OK
没有笔误的话,编译完成以后重启就会发现横屏了~~~
TARGET->General->Deployment Info->Device Orientation中进行勾选就完事了
必须修改代码
首先,以上的部分必须选择
Landscape Left
Landscape Right
这2个选项
若仅仅如此,直接编译通过。再运行,则会出现app crash的情况,而且输出以下提示
** Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’,reseason:’Supported orientations has no common orientation with the application, and shouldAutoroate is returning YES’
然后输出一些traceback的东西
解决方法
在AppController.mm中编写以下接口
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){ return UIInterfaceOrientationMaskAll; }else{ return UIInterfaceOrientationMaskAllButUpsideDown; } }
OK,crash 的问题到此为止解决了
接下来编译运行,还是竖屏的,原因在于RootViewController.mm中所有的接口都是返回的竖屏,只要修改以后2个接口就OK
(BOOL) shouldAutoroateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ // return UIInterfaceOrientationIsPortrait(interfaceOrientation); return UIInterfaceOrientationIsLandscape(interOrientation); } -(NSUInteger)supportedInterfaceOrientations { #ifdef __IPHONE_6_0 // return UIInterfaceOrientationMaskPortrait; return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft; #endif }
没有笔误的话,编译完成以后重启就会发现横屏了~~~
相关文章推荐
- cocos2d-x 3.0触摸机制的用法
- 在vs2012 cocos2d-x 3.2项目中导入CocoStudio库
- 在vs2012 cocos2d-x 3.2项目中导入CocoStudio库 分类: cocos2d安装设置 2015-07-08 18:04 17人阅读 评论(0) 收藏
- vs2012引入新lib 分类: cocos2d安装设置 2015-07-08 18:01 21人阅读 评论(0) 收藏
- cocos2d-x(quick--cocos2d-x)引擎开发的游戏在android平台上,锁屏,按HOME键,重反游戏后黑屏问题
- Cocos2d-x编程中的runOnUiThread方法和runOnGLThread方法剖析
- cocos2dx实现android的对讯飞语音的合成(语言朗读的实现)
- cocos2d-js v3.1的坑
- 大海教你学手游2015CocosLua第一季_01环境搭建与场景封装
- 大海教你学手游2015CocosLua第一季_00课程介绍
- 大海教你学手游2015CocosLua第一季_00课程介绍
- 大海教你学手游2015CocosLua第一季_01环境搭建与场景封装
- 【麦可网】Cocos2d-X跨平台游戏开发学习笔记---第二十七课:Cocos2D-X物理引擎之chipmunk
- Cocos2dx 3.0 过渡篇 (二十一)自从Label有了freeType做靠山以后...
- 【转载】TexturePacker 如何使用自带的加密功能及在cocos2dx中的使用
- Cocos2dx中播放多个音效冲突问题
- cocos2d-x的anchorPoint锚点和scale缩放之间的配合方式
- 安卓调试 cocos2d
- Cocos2d-x 3.2 Lua示例FontTest(字体测试)
- cocos2dx实现电脑Enter、Escape、方向键的响应