【发布时间】:2014-12-03 08:21:06
【问题描述】:
我有一个 FirstViewController 和 TabBarController 和 NavigationController
(TabBarController > NavigationController > UIViewController)
在firstViewController上按UIButton时,会推送到SecondViewController。
SecondViewController *vc2 = [self.storyboard instantiateViewControllerWithIdentifier:@"BVC"];
vc2.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc2 animated:YES];
在SecondViewController 的右下角有一个UILabel,带有约束 - (Width-Equal, Height-Equal, TrailingSpaceToSuperView = 16,BottomSpaceToBottomLayoutGuide = 20)
结果在 iphone4s(IOS7) 上运行良好,但在 iphone6(IOS8.1) 上,UILabel 将首先出现在右下角加上大约 1 秒的“BottomBar 高度”,然后将更新到正确的位置( BottomSpaceToBottomLayoutGuide = 20)
当我将 pushViewController 动画设置为 NO 时,UILabel 将立即显示在正确的位置。
[self.navigationController pushViewController:vc2 animated:NO];
有人遇到同样的问题吗?
【问题讨论】:
-
当这种情况发生在我身上时,我会通过重置约束来修复它,或者我将它留给 XCOde 建议来应用约束
-
是的,谢谢您的建议。虽然,当涉及到屏幕按钮上的视图(Height-Equals TrailingSpace、LeadingSpace、bottomSpace)时,这个建议不起作用。
标签: ios autolayout pushviewcontroller