旋转设备后未调整“后退"按钮的大小 [英] Back button not resized after device rotation
本文介绍了旋转设备后未调整“后退"按钮的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将XCode 7更改为XCode 9后,旋转设备后,所有视图控制器上的后退按钮将停止正确调整大小.
After I change XCode 7 to XCode 9, back button at all viewcontrollers stop correctly resizing after device rotation.
加载ViewController时的导航栏:
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
推荐答案
在您的viewController中的方法
In your viewController in the method
override func viewDidLayoutSubviews()
只需添加一行 self.navigationController?.navigationBar.setNeedsLayout()
.
这篇关于旋转设备后未调整“后退"按钮的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文