Back button not resized after device rotation

2019-08-16 14:49发布

问题:

After I change XCode 7 to XCode 9, back button at all viewcontrollers stop correctly resizing after device rotation.

Navigation bar when viewcontroller loaded:

Navigation bar after change orientation to landscape and back to portrait: Button and title at different levels and arrow smaller then at first picture

回答1:

In your viewController in the method

override func viewDidLayoutSubviews()

just add a line self.navigationController?.navigationBar.setNeedsLayout().