quickcocos2dx xcode 6.3 中项目横屏设置
来源:互联网 发布:颜色特征提取算法 编辑:程序博客网 时间:2024/04/29 13:00
今天在捣鼓项目的时候发现,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中编写以下接口
- (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}
没有笔误的话,编译完成以后重启就会发现横屏了~~~
0 0
- quickcocos2dx xcode 6.3 中项目横屏设置
- xcode 各种项目设置
- Xcode非ARC项目中设置部分文件ARC支持
- Xcode非ARC项目中设置部分文件ARC支持
- Xcode非ARC项目中设置部分文件ARC支持
- Xcode非ARC项目中设置部分文件ARC支持
- Xcode非ARC项目中设置部分文件ARC支持
- Xcode非ARC项目中设置部分文件ARC支持
- xcode中设置项目属性,运行、调试在真机
- Xcode非ARC项目中设置部分文件ARC支持
- quickCocos2dx 中添加自定义类,导出lua
- quickcocos2dx cocostudio的panle中添加cclayer
- XCode中设置字体大小
- XCode中设置字体大小
- 关于Xcode横屏设置问题
- IOS开发之----Xcode非ARC项目中设置部分文件ARC支持
- IOS开发之----Xcode非ARC项目中设置部分文件ARC支持
- IOS开发之----Xcode非ARC项目中设置部分文件ARC支持
- linux开机自动连接无线网络
- 易經大意原稿(頁單位) 151-175
- ios 字符串判断代码
- arm ld link scrip编写
- 使用JS实现前端缓存
- quickcocos2dx xcode 6.3 中项目横屏设置
- Ubuntu 14.04 为 root 帐号开启 SSH 登录
- Java内存分配和String类型的深度解析***
- STL - map
- 易經大意原稿(頁單位) 126-150
- 朴素贝叶斯方法
- HTML打开Excel文件
- Java注释 基本的几个注释词应用
- OC-初始化方法-便利构造器(练习-约分)