Giter Club home page Giter Club logo

hsplayerfullscreendemo's Introduction

HSPlayerFullScreenDemo

播放器旋转Demo

hsplayerfullscreendemo's People

Contributors

cnthinkcode avatar hoxiaojian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hsplayerfullscreendemo's Issues

UITabBarViewController 為 AppDelegate 的 rootViewController 前景背景切換 layout 會跑版

情境:

在我開發的 App 中有個需求是 AppDelegate rootViewController 必須是 UITabBarViewController,發現只要使用多個

UIWindow 方式切換至橫屏,快速下拉至控制中心讓 App 經過 willResignActive, didBecomeActive 生命週期,這時從橫屏

返回直屏並返回到 rootViewController layout 有機會跑版,看起來像是 safe area 沒有回復至直屏的樣子。

Demo 跑版:

GIF

在 HSPlayerFullScreenDemo example 中我更改了什麼:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        let rootController = ViewController.init()
        let rootController2 = ViewController.init()
        let rootController3 = ViewController.init()
        window = UIWindow.init(frame: UIScreen.main.bounds)
        let tab = UITabBarController()
        let a = UINavigationController.init(rootViewController: rootController)
        a.tabBarItem = UITabBarItem(title: "A", image: nil, selectedImage: nil)
        let b = UINavigationController.init(rootViewController: rootController2)
        b.tabBarItem = UITabBarItem(title: "B", image: nil, selectedImage: nil)
        let c = UINavigationController.init(rootViewController: rootController3)
        c.tabBarItem = UITabBarItem(title: "C", image: nil, selectedImage: nil)

        tab.viewControllers = [a,b,c]
        window?.rootViewController = tab
        window?.makeKeyAndVisible()
        
        return true
    }

不知道您有沒有遇過類似的狀況,網路上找很久沒找到解法

有的個方向就太好了 感謝~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.