您的位置:首页 > 移动开发 > Cocos引擎

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

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐