【问题标题】:Is there any way to get rid of short ViewController with storyboard? [duplicate]有什么办法可以摆脱带有情节提要的短 ViewController 吗? [复制]
【发布时间】:2020-03-12 12:47:25
【问题描述】:

我的代码是

else if indexPath.row == 4 {

            FUser.logOutCurrentUser { (success) in
                if success {
                    tableView.deselectRow(at: indexPath, animated: true)
                    let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(identifier: "welcome") as! Login_VC
                    self.present(vc, animated: true, completion: nil)
                } else {
                    self.alertController(title: "Alert !", message: "Network error. Try again in sometime.", titleAction: "Ok")
                }
            } // end of fuser
        } // end of else index 4

【问题讨论】:

    标签: ios swift uiviewcontroller


    【解决方案1】:

    将 UIViewcontroller 的 modalPresentationStyleautomatic 更改为 fullscreen

    https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e

    你也可以看看这个帖子: Presenting modal in iOS 13 fullscreen

    来自这个帖子的解决方案:

    let vc = UIViewController()
    vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency
    self.present(vc, animated: true, completion: nil)
    

    您也可以在 Xcode Interface Builder 中更改此属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-06
      • 2023-04-10
      • 1970-01-01
      • 2020-02-05
      • 2012-07-29
      • 2011-12-26
      • 2011-09-02
      • 1970-01-01
      相关资源
      最近更新 更多