quick cocos2d新建项目,在xcode中 起模拟器,默认的是竖屏,我想做一个横屏的游戏,前面已经说了

选中你的项目,在General这个标签内,Deoployment info的这个分组,有一个Device Orientation 标签,内有一个Portrait的选项,选中是竖屏,取消选中是横屏

这里的横屏竖屏只是你显示的状态,而并非是你摆放游戏资源或者写代码按照坐标排布的横屏,这时候要设置Landscape Right,但是选中以后,就会直接崩溃

int main(int argc, char *argv[]) {

NSAutoreleasePool *pool = [NSAutoreleasePool new];

int retVal = UIApplicationMain(argc, argv, nil, @"AppController");//会崩溃在这一句

[pool release];

return retVal;

Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RootViewController shouldAutorotate] is returning YES'

libc++abi.dylib: terminating with uncaught exception of type NSException

这里的原因也已经讲清楚了,是你的初始化不支持横屏,我们需要做一个修改

在RootViewController.mm  中

// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead

- (NSUInteger) supportedInterfaceOrientations

{

//加上这一句,然后试一下,一切 ok

return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;

#ifdef __IPHONE_6_0

return UIInterfaceOrientationMaskPortrait;

#endif

}

 

quick-cocos2d 设置横屏的更多相关文章

  1. Android之设置横屏竖屏

    方案一:在AndroidManifest.xml中配置 在项目的AndroidManifest.xml中找到你所指定的activity中加上Android:screenOrientation属性,它有 ...

  2. cocos2dx 2.0+ 版本,IOS6.0+设置横屏

    使用cocos2dx 自带的xcode模板,是不能正常的设置为横屏的. 一共修改了三个地方: 在项目属性中:Deployment Info中,勾选上 Landscape left,以及 Landsca ...

  3. Android 设置 横屏 竖屏 (转)

    http://2960629.blog.51cto.com/2950629/701227 方法一:在AndroidManifest.xml中配置 如果不想让软件在横竖屏之间切换,最简单的办法就是在项目 ...

  4. Android 设置横屏或竖屏

    方法一:在AndroidManifest.xml中配置 如果不想让软件在横竖屏之间切换,最简单的办法就是在项目的AndroidManifest.xml中找到你所指定的activity中加上androi ...

  5. Android 设置 横屏 竖屏

    方法一:在AndroidManifest.xml中配置 如果不想让软件在横竖屏之间切换,最简单的办法就是在项目的AndroidManifest.xml中找到你所指定的activity中加上androi ...

  6. android设置横屏和竖屏的方法

    方法一:在AndroidManifest.xml中配置 假设不想让软件在横竖屏之间切换,最简单的办法就是在项目的AndroidManifest.xml中找到你所指定的activity中加上androi ...

  7. Android 强制设置横屏或竖屏 设置全屏

    (转自:http://blog.csdn.net/yuejingjiahong/article/details/6636981) 强制横屏: @Override protected void onRe ...

  8. 程序设置横屏后,锁屏时会被销毁一遍,解锁时又重新加载onCreat的问题解决

    今天在写一个应用的时候,因为需要设置成横屏模式,所以在Manifest里面的Activity里面加了两个参数设置: android:screenOrientation="landscape& ...

  9. Android强制设置横屏或竖屏

    全屏 在Activity的onCreate方法中的setContentView(myview)调用之前添加下面代码 requestWindowFeature(Window.FEATURE_NO_TIT ...

随机推荐

  1. 查看sqlserver表空间

    exec sp_msforeachtable "exec sp_spaceused '?'"

  2. OgnlValueStack 源码

    /* * Copyright 2002-2006,2009 The Apache Software Foundation. * * Licensed under the Apache License, ...

  3. [luogu1357] 花园 [dp+矩阵快速幂]

    题面: 传送门 思路: 把P形花圃记录为0,C形记录为1,那么一段花圃就可以状态压缩成一个整数 那么,我们可以有这样的状压dp: dp[i][S]表示前i个花圃,最后m个的状态为S的情况 如果这是一条 ...

  4. [SCOI2011][bzoj2331] 地板 [插头dp]

    题面: 传送门 思路: 插头dp基础教程 这个L形......第一眼看上去真的是丧病啊 但是仔细想想,实际上也就是拿一堆路径铺满一个棋盘,这个路径还是有限制的 那还有什么好说的,插头dp上啊[雾] 首 ...

  5. [ZJOI2012][bzoj 2816] 网络 network [LCT]

    题目: http://www.lydsy.com/JudgeOnline/problem.php?id=2816 思路: 第一个条件看完暂时还没什么想法 看完第二个,发现每一个颜色都是一个森林 进而想 ...

  6. 论文笔记:《OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks DeepLearning 》

    一.Abstract综述 训练出一个CNN可以同时实现分类,定位和检测..,三个任务共用同一个CNN网络,只是在pool5之后有所不同 二.分类 这里CNN的结构是对ALEXNET做了一些改进,具体的 ...

  7. Educational Codeforces Round 8 B 找规律

    B. New Skateboard time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  8. iOS-Cocoapods更新不及时

    一.问题 使用cocoapods搜索某些库时,搜索到的版本低于Github上面的版本,这样会导致一些问题.例如我在使用一个LTNavigationBar这个库时,在我升级到iOS10的时候,会导致导航 ...

  9. Ubuntu 查看默认软件安装位置

    tags: Linux 方法 1:在命令行输入:dpkg -L 软件包名: 方法 2:在/var/cache/apt/archives找的你安装程序的包,然后用gdebi-gtk+软件包名可以查看具体 ...

  10. jmeter作接口测试入门的简单使用说明

    一.添加接口信息 1.添加线程组 (1)路径如下图: (2)部分内容解释 a.  Number of Threads(users):线程数 b.  Ramp-Up Period(in seconds) ...