Presenting modal in iOS 13 fullscreen

后端 未结 30 2669
囚心锁ツ
囚心锁ツ 2020-11-21 06:48

In iOS 13 there is a new behaviour for modal view controller when being presented.

Now it\'s not fullscreen by default and when I try to slide down, the app just dis

30条回答
  •  深忆病人
    2020-11-21 07:22

    As a hint: If you call present to a ViewController which is embedded inside a NavigationController you have to set the NavigationController to .fullScreen and not the VC.

    You can do this like @davidbates or you do it programmatically (like @pascalbros).

    The same applies to the UITabViewController

    An example scenario for NavigationController:

        //BaseNavigationController: UINavigationController {}
        let baseNavigationController = storyboard!.instantiateViewController(withIdentifier: "BaseNavigationController")
        var navigationController = UINavigationController(rootViewController: baseNavigationController)
        navigationController.modalPresentationStyle = .fullScreen
        navigationController.topViewController as? LoginViewController
        self.present(navigationViewController, animated: true, completion: nil)
    

提交回复
热议问题