When I rotate the screen to Landscape and then rotate back to Portrait the back button drop down somehow like this.
not only the title of back button but also the image drop down. I tried to set the frame by the back button's frame before rotation but it's not working. I'm sure the custom image of the back button is irrelevant.
The wired thing is I open an new testing project to reproduce the situation but it work perfectly. I checked every setting in Navigation Controller from storyboard
or setting in Navigation Bar
They are all the same with my original project. What do I missing?
This drop down only occur in iOS11.
Could it be the bug of iOS11?
Please help. THX
ps I'm using Xcode9.2
It seems that calling setNeedsLayout()
(as suggested here ) works.
override func viewDidLayoutSubviews() {
navigationController?.navigationBar.setNeedsLayout()
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.