So my problem is related to auto-layout and the bottom layout guide.
Here's the design of the app:
UITabBarController
^-- Tab1: NavigationController with VC1 as root
^-- VC2 is pushed and hides the tab bar (full screen, top layout is situated under the nav bar, bottom layout should be the lowest pixel).
When VC2 is pushed, the bottom layout guide is 49 points length during a small amount of time and then it's 0.
During this time, my subviews which are constrained to this bottom guide are positioned incorrectly.
When the guide is then correctly set to 0 (by the navigation controller itself, there's no code from me regarding this), the subviews positions are then perfect.
This does not happen on iOS 7.x (the app supports 7.0+)... I'm pretty sure that's a iOS 8 bug and I was looking for a workaround, but I could not find something that fixes this.
I tried to solve the issue forcing the navigation controllers'view to layout in view(Will/Did)LayoutSubviews, but it did not help.
I saw this post is related but the suggested solution does not work. Presenting the VC2 modally solves the issue but that's not acceptable.
Thanks in advance for your help, let me know if you need more explanations
I'm having a similar issue like this with a UIPageViewController. After some initial research it does appears to be a bug. The only way I have managed to resolve this is to pin the subview to the superview instead of the bottom layout guide like so.
The constraint does seem to be respected once the subview is pinned to the superview.
Hope this helps.
If you are using Auto Layout, try unchecking "Extend Edges->Under Bottom Bars" setting for TabBarController and all its ViewControllers in Interface Builder.
I solved my issue by setting the tabbar translucent as No
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.tabBarController.tabBar.translucent = NO;
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.tabBarController.tabBar.translucent = self.isTabBarTranslucent;
}
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