cocos2d-x 2.14 在IOS 6.1 中竖屏设置
2013-11-20 17:33
344 查看
cocos2d-x 2.14 在IOS 6.1 中竖屏设置方法如下:
看图找到 RootViewController.mm 文件
之后打开RootViewController.mm 文件,找到如下代码,并按照我写的注释修改就行了
[cpp] view
plaincopyprint?
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//横屏用这个
//return UIInterfaceOrientationIsLandscape( interfaceOrientation );
//竖屏用这个
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//横屏用这个
//return UIInterfaceOrientationMaskLandscape;
//竖屏用这个
return UIInterfaceOrientationMaskPortrait;
#endif
}
看图找到 RootViewController.mm 文件
之后打开RootViewController.mm 文件,找到如下代码,并按照我写的注释修改就行了
[cpp] view
plaincopyprint?
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//横屏用这个
//return UIInterfaceOrientationIsLandscape( interfaceOrientation );
//竖屏用这个
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//横屏用这个
//return UIInterfaceOrientationMaskLandscape;
//竖屏用这个
return UIInterfaceOrientationMaskPortrait;
#endif
}
相关文章推荐
- cocos2d-x 2.14 在IOS 6.1 中竖屏设置
- 【Cocos2d-x】 关于IOS设置竖屏后,运行会报错的解决方法
- [寒江孤叶丶的Cocos2d-x之旅_07]各平台设置竖屏的方法。ios如何设置竖屏?Android如何设置竖屏?WP8如何设置竖屏?
- 使用cocos2d-x时在ios上设置竖屏ZZ
- 使用cocos2d-x时在ios上设置竖屏
- 使用cocos2d-x时在ios上设置竖屏ZZ
- cocos2d:Android和iOS中Cocos2dx的横屏竖屏设置
- 使用cocos2d-x时在ios上设置竖屏
- 使用cocos2d-x时在ios上设置竖屏
- Cocos2d-x 2.x设置竖屏方法 android ios
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)! .
- 【iOS-Cocos2d游戏开发之八】开启高清(960*640)模式问题与解答、图片适配以及设置iphone横竖屏 推荐
- IOS中设置屏幕只支持竖屏的方法
- Android和iOS中Cocos2dx的横屏竖屏设置
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)!
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)! .
- ios-Xcode引用VLCKit之后如何设置更高的Deployment Target(比6.1高)
- cocos2d怎么设置屏幕朝向?横屏 or 竖屏设置
- quick-cocos2d-x 3.3rc0 与 2.2.5的区别(三)真机上设置横屏与竖屏
- 【iOS-cocos2d-X 游戏开发之十六】Cocos2dx编译后的Android自动使用(-hd)高清图&设置自适应屏幕