We started working on our project with Xcode 8.3 and it was all fine till iOS 10 but when we run our same app in iOS 11 the back button is not aligned as intended as you see in the image below
But with iOS 10 it's aligned properly
And this what the layout constraint error we are getting
(
"<NSLayoutConstraint:0x600000288200 _UIModernBarButton:0x7f7ef5c87f10.bottom == UILayoutGuide:0x6000005a0380'UIViewLayoutMarginsGuide'.bottom + 64.5 (active)>",
"<NSLayoutConstraint:0x600000287f30 V:[_UIModernBarButton:0x7f7ef5c87f10]-(>=0)-| (active, names: '|':_UIButtonBarButton:0x7f7ef5c86e60 )>",
"<NSLayoutConstraint:0x600000282030 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6000005a0380'UIViewLayoutMarginsGuide']-(16)-| (active, names: '|':_UIButtonBarButton:0x7f7ef5c86e60 )>"
)
For me it is because I use some tricks like below to hide the title
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -1000), for: .default)
We should not do that, it does not work on iOS 11 and will trigger lots of Auto Layout issue like you post. So check if you have appearance
on back button.
If you really want to hide text on the back button, you should do https://stackoverflow.com/a/46889050/1418457
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With