pushViewController原因使用hidesBottomBarWhenPushed(iphone6)

问题描述:

的autoLayout问题,我有一个FirstViewControllerTabBarControllerNavigationController (TabBarController> NavigationController>的UIViewController)pushViewController原因使用hidesBottomBarWhenPushed(iphone6)

当在firstViewControllerUIButton,它会推到SecondViewController

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

vc2.hidesBottomBarWhenPushed = YES; 

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

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

上iphone4s的结果工作精细(IOS7 ),但在UILabel将首先出现在右下角加上一个“BottomBar高度”,那么约1秒将更新到正确的位置iphone6(IOS8.1)(BottomSpaceToBottomLayoutGuide = 20)

当我设置pushViewController动画到NO, UILabel将立即显示在正确的位置。

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

任何人都遇到同样的问题?

+0

当这发生在我身上我通过重置约束来修复它,或者我把它留给XCOde建议来应用约束 – meda 2014-12-03 08:25:33

+0

是的,谢谢你的建议。虽然,当涉及到屏幕按钮上的查看(Height-Equals TrailingSpace,LeadingSpace,bottomSpace)时,该建议不起作用。 – Jenny 2014-12-03 08:47:24

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

enter image description here

+0

谢谢!解决了我的问题! :) – Georg 2015-08-17 07:07:26

+1

隐藏在Xcode 7中,但仍然有效:http://*.com/questions/29021129/constrain-view-bottom-to-superview-bottom-not-bottomlayoutguide-in-storyboard/33432500#33432500 – 2015-11-08 23:28:07

@珍妮的做法,现在被隐藏在Xcode 7,但你可以打开你的故事板的源代码,发现这个约束,并手动将其设置为“底部”。为了简化搜索,只需从Identity Inspector中复制ObjectID即可。