zoukankan      html  css  js  c++  java
  • cocos2d-x ios 设置横屏/竖屏(全)

    Cocos2d-x项目iOSRootViewController.mm文件中。

    以下方法任选其一即可…      本人机子函数二ok!


    函数一:

    (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

        return UIInterfaceOrientationIsLandscape( interfaceOrientation );

    //    return (UIInterfaceOrientationIsPortrait( interfaceOrientation ));

    }

     

    函数二:

    - (NSUInteger) supportedInterfaceOrientations{

    #ifdef __IPHONE_6_0

        return UIInterfaceOrientationMaskLandscape;

    //     return UIInterfaceOrientationMaskPortrait;

    //    直式显示: protrait

    //    横式显示: landscape

    #endif

    }


    函数三:

    - (BOOL) shouldAutorotate {

        returnYES;

    //    return NO;

    }


    还有最后关键的一点:

    用xcode肯定知道在哪里!这里是屏幕和内容关系,模拟器图也有。


  • 相关阅读:
    tcp粘包解决
    socket网络编程
    logging模块
    异常处理
    hashlib configparser模块
    列表推导式和生成器表达式和内置函数
    迭代器与生成器
    装饰器
    函数
    文件操作
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3343491.html
Copyright © 2011-2022 走看看