How to prevent gap between uinavigationbar and view in iOS 13?

后端 未结 2 1388
-上瘾入骨i
-上瘾入骨i 2021-02-02 09:33

We are currently having an issue with navigation bar sizing when using modal presentation in iOS 13.

In most cases this works fine as can be seen in this screenshot:

2条回答
  •  一个人的身影
    2021-02-02 10:24

    override func viewWillAppear(_ animated: Bool) {  
        super.viewWillAppear(animated)  
        if #available(iOS 13.0, *) {  
            navigationController?.navigationBar.setNeedsLayout()  
        }
    }  
    

    We found this work around here and it worked for us.

提交回复
热议问题