• IOS 5.0 6.0 横竖屏 处理总结


    简单的来说用xcode4.5直接创建的项目是直接支持 ios6.0横竖屏的,但是用IOS5.0的模拟器运行发现不支持横竖屏,这时候就要把以前的 横竖屏函数搬出来了。

    针对横屏示例:

    // ios5下的横屏

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);

    }

    // ios6下的横屏

    -(BOOL)shouldAutorotate {

    return YES;

    }

    -(NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskLandscape;

    }

    对于有 navigation的 IOS6的需求,A(竖屏) 推出的B  B要只能横屏,这时候就需要实现一个navigation的子类的,然后在这个子类实现如下的代码

    -(NSUInteger)supportedInterfaceOrientations{  

        if([[self topViewController] isKindOfClass:[SubSubView class]])  

            return UIInterfaceOrientationMaskAllButUpsideDown;  

           return UIInterfaceOrientationMaskPortrait;  

    }

    -(NSUInteger)supportedInterfaceOrientations{

        if([[self topViewController] isKindOfClass:[SubSubView class]])

            return UIInterfaceOrientationMaskAllButUpsideDown;

        else

            return UIInterfaceOrientationMaskPortrait;

    }

    然后 再在B里面实现转屏的函数就可以了。

  • 相关阅读:
    php环境下所有的配置文件以及作用
    获取登陆用户的ip
    curl模拟post和get请求
    linux 下安装php curl扩展
    php常用面试知识点
    git使用步骤
    laravel框架基础知识点
    ci框架基础知识点
    ajax
    Mysql 中需不需要commit
  • 原文地址:https://www.cnblogs.com/superhappy/p/3013851.html
Copyright © 2020-2023  润新知