I'm having a frustrating time getting an auto layout issue to work. Hopefully some fresh eyes on the problem will be better at finding a solution...
I have a UITabBarController in a storyboard file, and in the first view controller there is a MKMapView and a button:
The button is constrained to the bottom of the View Controller's view's safe area. The MKMapView is constrained to its superview. And this works fine so far.
The problem comes when I rotate the phone. In the UITabBarController's viewWillTransitionToSize:withTransitionCoordinator:
method, I call [self.tabBar setHidden:(size.height < kMinViewSize)]
in order to hide the tab bar when the view's height is too small.
After hiding the tab bar, this is what I get:
And then when I rotate back to portrait mode again, the tab bar unhides as it should, but the layout gets screwed up once again:
And, finally, if I select another tab, then come back to the map tab, the button moves back to the correct location.
Am I missing something obvious? Thanks in advance for your help!