Multiple Modally Presented (page sheet) ViewControllers Navigation Item Bug

不羁岁月 提交于 2020-01-17 14:04:06

问题


iOS 13. The problem is shown on the screenshot.

The steps are:

  1. Open one view controller modally with page sheet style.

  2. Open another (second) view controller modally with page sheet style.

Expected: no Nav Bar bug

Actual: see screenshot

The source code is available here: https://github.com/rinat-enikeev/NavBarBug

Question: how to fix this bug? I want to present 2 view controllers modally with page sheet style.


回答1:


Ok, for those who faced the same issue. The workaround is to add the following code to the viewDidLoad method:

if #available(iOS 13, *) {
    let appearance = navigationController?.navigationBar.standardAppearance.copy()
    navigationItem.standardAppearance = appearance
}


来源:https://stackoverflow.com/questions/58266232/multiple-modally-presented-page-sheet-viewcontrollers-navigation-item-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!