zoukankan      html  css  js  c++  java
  • app让个别界面横屏,其他的为竖屏,解决如下

    app让个别界面横屏,其他的为竖屏,解决如下

    APP设置里面,一定要设置可以旋转的方向

    appdelegate里面重新系统方向代理

    func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {

     

            return UIInterfaceOrientationMask.Portrait  // 设置全部为竖屏

        }

    在想要实现横屏的controller里面重写

    是否支持自动横屏,

    override func shouldAutorotate() -> Bool {

            return false

        }

     支持的方向

        override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {

             

            return UIInterfaceOrientationMask.Landscape  // 代表横屏,左右横屏

        }

    物理显示屏幕,即将显示屏幕方向

        override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {

            

                return UIInterfaceOrientation.LandscapeLeft

        }

     

    如果此controller含nav,应该在nav里面重写这个方法,controller不需要写

     

  • 相关阅读:
    webIDE 第二篇博文
    前端第一天
    记昨天
    入职第四天
    入职第二天
    linux常用命令,自己总结
    一切从头开始
    在服务器上搭建SVN
    Dynamic CRM 365学习历程--JS
    Dynamic CRM 365学习历程--有关CRM的学习过程种需要注意的事项
  • 原文地址:https://www.cnblogs.com/YangFuShun/p/5756874.html
Copyright © 2011-2022 走看看