Padding wrong when presenting second modal navigation controller on iOS 13
问题 On iOS 13, when presenting a second modal view controller over a first one, the padding is incorrect on the button bar items. In particular, the right margin disappears. How should this be fixed? 回答1: This behavior is due to a bug in iOS 13. It can be fixed by calling setNeedsLayout on the Navigation Bar. Swift example: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if #available(iOS 13.0, *) { navigationController?.navigationBar.setNeedsLayout() } } Objective