zoukankan      html  css  js  c++  java
  • Cocos2d2.0横竖屏

    Cocos2d-2.0横竖屏设置

    <AppDelegate.m>iOS 6+设置使用

     1 // Only valid for iOS 6+. NOT VALID for iOS 4 / 5.
     2 -(NSUInteger)supportedInterfaceOrientations {
     3     
     4     // iPhone only
     5     if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
     6         return UIInterfaceOrientationMaskPortrait;  //竖屏设置
     7         //return UIInterfaceOrientationMaskLandscape;    //横屏设置
     8     
     9     // iPad only
    10     return UIInterfaceOrientationMaskPortrait;  //竖屏设置
    11     //return UIInterfaceOrientationMaskLandscape;    //横屏设置
    12 }

    <AppDelegate.m>iOS 4/5设置使用

     1 // Only valid on iOS 4 / 5. NOT VALID for iOS 6.
     2 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
     3 {
     4     // iPhone only
     5     if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
     6         return UIInterfaceOrientationIsPortrait(interfaceOrientation);  //竖屏设置
     7         //return UIInterfaceOrientationIsLandscape(interfaceOrientation);   //横屏设置
     8     
     9     // iPad only
    10     // iPhone only
    11     //return UIInterfaceOrientationIsLandscape(interfaceOrientation);   //横屏设置
    12     return UIInterfaceOrientationIsPortrait(interfaceOrientation);  //竖屏设置
    13 }
  • 相关阅读:
    L3-007. 天梯地图
    智能算法-遗传算法
    L2-012. 关于堆的判断
    L2-010. 排座位
    计算几何初步-三点顺序
    L3-001. 凑零钱
    靠二进制画几何[图论]
    【排序】
    欧拉路与欧拉回路
    Test on 2016/09/26
  • 原文地址:https://www.cnblogs.com/ADaii/p/2860442.html
Copyright © 2011-2022 走看看