cocos2d-x 2.14 在IOS 6.1 中竖屏设置

来源:互联网 发布:淘宝直通车推广费用 编辑:程序博客网 时间:2024/05/30 04:19

cocos2d-x 2.14 在IOS 6.1 中竖屏设置方法如下:

看图找到 RootViewController.mm 文件



之后打开RootViewController.mm 文件,找到如下代码,并按照我写的注释修改就行了

[cpp] view plaincopyprint?
  1. // Override to allow orientations other than the default portrait orientation.  
  2. // This method is deprecated on ios6  
  3. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {  
  4.     //横屏用这个  
  5.     //return UIInterfaceOrientationIsLandscape( interfaceOrientation );  
  6.       
  7.     //竖屏用这个  
  8.     return  UIInterfaceOrientationIsPortrait(interfaceOrientation);  
  9. }  
  10.   
  11. // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead  
  12. - (NSUInteger) supportedInterfaceOrientations{  
  13. #ifdef __IPHONE_6_0  
  14.     //横屏用这个  
  15.     //return UIInterfaceOrientationMaskLandscape;  
  16.       
  17.     //竖屏用这个  
  18.     return UIInterfaceOrientationMaskPortrait;  
  19. #endif  
  20. }  
原创粉丝点击