• 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 }
  • 相关阅读:
    60个生僻成语汇总
    人民网 ***讲话
    组合排序
    工具
    网络之网络设备
    《TCP协议到TCP通讯各种异常现象和分析》的学习
    Console
    RTT学习之ulog
    RTT之MQTT学习笔记
    项目管理-禅道
  • 原文地址:https://www.cnblogs.com/ADaii/p/2860442.html
Copyright © 2020-2023  润新知