问题
iOS 13. The problem is shown on the screenshot.
The steps are:
Open one view controller modally with page sheet style.
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