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 }
  • 相关阅读:
    lLinux 下 Stress 压力测试工具
    zabbix 微信告警配置
    spark Intellij IDEA开发环境搭建
    Spark调优与调试
    在centos 6.5 x64中安装 spark-1.5.1
    二叉树的各种遍历算法
    ServletResponse的一些知识点
    UVA 10303 How Many Trees? (catlan)
    UVA 10183 How Many Fibs?
    UVA 10471 Gift Exchanging
  • 原文地址:https://www.cnblogs.com/ADaii/p/2860442.html
Copyright © 2011-2022 走看看