美文网首页
iOS--解决屏幕旋转后, presentController

iOS--解决屏幕旋转后, presentController

作者: 请叫我大帅666 | 来源:发表于2019-08-19 19:38 被阅读0次
//开始的方向
// 解决旋转屏幕后页面倒置问题
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    UIViewController *currentVc = [self getCurrentVC];
    if(currentVc.presentingViewController.preferredInterfaceOrientationForPresentation == UIDeviceOrientationLandscapeLeft || currentVc.presentingViewController.preferredInterfaceOrientationForPresentation == UIDeviceOrientationLandscapeRight){
        return currentVc.presentingViewController.preferredInterfaceOrientationForPresentation;
    }else{
        if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight) {
            self.interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
            return UIInterfaceOrientationLandscapeLeft;
        } else if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) {
            self.interfaceOrientation = UIInterfaceOrientationLandscapeRight;
            return UIInterfaceOrientationLandscapeRight;
        }
        return self.interfaceOrientation;
    }
}

相关文章

  • iOS--解决屏幕旋转后, presentController

  • iOS 屏幕旋转

    屏幕旋转 认知 期望达到的目的 如何让App支持屏幕旋转 如何让App屏幕旋转 如何保证屏幕旋转后布局不会乱 总结...

  • Runtime解决屏幕旋转问题

    前言 大家或许在iOS程序开发中经常遇到屏幕旋转问题,比如说希望指定的页面进行不同的屏幕旋转,但由于系统提供的方法...

  • Android EditTextView.setText()无效

    解决方法: 原因: 安卓会自动保存某些view的状态,旋转屏幕或打开一个活动后,onSaveInstanceSta...

  • rem 手机屏幕适配

    手机端屏幕适配解决方案(含屏幕旋转): danhuan 阅读笔记 2018.04.02文章:https://m...

  • Android横竖屏切换总结

    如何设置屏幕方向 用户手动设置在开启手机的自动旋转功能后旋转屏幕即可。 代码设置通过Activity类的setRe...

  • 屏幕旋转

    屏幕旋转 推荐文档 了解UIWindow——UIWindow实践 iOS屏幕旋转问题总结 IOS:屏幕旋转与变换 ...

  • iOS屏幕旋转解决方案

    1.导航控制器栈内部的VC方向是导航控制器来决定的。nav --- A --- B --- C,C的旋转方法是不起...

  • 屏幕旋转

    在做工程的时候碰到了屏幕旋转的问题,如今已经解决.为大家分享一下 屏幕旋转机制流程 (1)加速计检测到方向变化,发...

  • iOS 横竖屏切换

    网上关于横竖屏切换的资料很多,但是很容易踩到坑,不是屏幕不旋转,就是屏幕旋转后没有状态栏等,在写的小demo里屏幕...

网友评论

      本文标题:iOS--解决屏幕旋转后, presentController

      本文链接:https://www.haomeiwen.com/subject/yqxadctx.html