pushViewController导致autoLayout问题使用hidesBottomBarWhenPushed(iphone6)

Jen*_*nny 4 pushviewcontroller ios autolayout

我有一个FirstViewControllerTabBarControllerNavigationController (TabBarController> NavigationController>的UIViewController)

当按下UIButtonfirstViewController,它会推到SecondViewController.

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

vc2.hidesBottomBarWhenPushed = YES;

[self.navigationController pushViewController:vc2 animated:YES];
Run Code Online (Sandbox Code Playgroud)

SecondViewController有一个UILabel上有约束的右下角- (宽度相等,高度相等,TrailingSpaceToSuperView = 16,BottomSpaceToBottomLayoutGuide = 20)

结果在iphone4s(IOS7)上运行正常,但在iphone6(IOS8.1)上,UILabel它将首先出现在右下角加上"BottomBar height"大约1秒,然后将更新到正确的位置(BottomSpaceToBottomLayoutGuide = 20)

当我将pushViewController动画设置为NO时,UILabel会立即显示在正确的位置.

[self.navigationController pushViewController:vc2 animated:NO];
Run Code Online (Sandbox Code Playgroud)

有人遇到同样的问题吗?

Jen*_*nny 7

我已经解决了这个问题.选择BottomSpaceToBottomLayoutGuide约束的底部.

在此输入图像描述