Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pushViewController cause autoLayout issue using hidesBottomBarWhenPushed (iphone6)

I have a FirstViewController with TabBarController and NavigationController (TabBarController > NavigationController > UIViewController)

When pressing the UIButton on the firstViewController, it will push to the SecondViewController.

SecondViewController *vc2 = [self.storyboard instantiateViewControllerWithIdentifier:@"BVC"];

vc2.hidesBottomBarWhenPushed = YES;

[self.navigationController pushViewController:vc2 animated:YES];

In SecondViewController there is an UILabel on the lower right corner with Constraints - ( Width-Equal, Height-Equal, TrailingSpaceToSuperView = 16,BottomSpaceToBottomLayoutGuide = 20 )

The result work fine on iphone4s(IOS7), but on iphone6(IOS8.1) the UILabel will first appear on the lower right corner plus a "BottomBar height" about 1 second then will update to the correct place (BottomSpaceToBottomLayoutGuide = 20)

When I set the pushViewController animated to NO, UILabel will show on the correct place immediately.

[self.navigationController pushViewController:vc2 animated:NO];

Anyone encounter the same issue?

like image 542
Jenny Avatar asked Jan 17 '26 15:01

Jenny


1 Answers

I've solve this issue. Select bottom of the BottomSpaceToBottomLayoutGuide Constraint.

enter image description here

like image 63
Jenny Avatar answered Jan 20 '26 05:01

Jenny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!