zoukankan      html  css  js  c++  java
  • 关于ios6.0和5.0的横竖屏支持方法

    iOS6.0中抛弃了- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation的方法对横竖屏切换的支持

    ios6.0中的对横竖切换的支持步骤为

    第一 info.plistSupported interface orientations中加入支持的方向
    第二 在 AppDelegate中加入 -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ return UIInterfaceOrientationMaskAll;} 
    第三 你想控制旋转的界面
    -(NSUInteger)supportedInterfaceOrientations{ 
        return UIInterfaceOrientationMaskPortrait // 可以修改为任何方向
    }
    -(BOOL)shouldAutorotate{
       return YES;
    }
    5.0的是
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
     
        return (toInterfaceOrientation == UIInterfaceOrientationPortrait);  // 你在这返回的参数中可以修改为任何你想支持方向
    }
     
  • 相关阅读:
    require笔札
    zepto_core
    2016年规划
    说说Q.js中的promise的历史
    jQuery.extend
    jQuery.core_02
    javascript之this指针
    javascript之闭包
    javascript之作用域链
    jvavascript之变量对象
  • 原文地址:https://www.cnblogs.com/leevaboo/p/2853014.html
Copyright © 2011-2022 走看看