pushViewController原因使用hidesBottomBarWhenPushed(iphone6)
的autoLayout问题,我有一个FirstViewController
与TabBarController
和NavigationController
(TabBarController> NavigationController>的UIViewController)pushViewController原因使用hidesBottomBarWhenPushed(iphone6)
当在firstViewController
按UIButton
,它会推到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];
任何人都遇到同样的问题?
我已经解决了这个问题。选择BottomSpaceToBottomLayoutGuide约束的底部。
谢谢!解决了我的问题! :) – Georg 2015-08-17 07:07:26
隐藏在Xcode 7中,但仍然有效:http://stackoverflow.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即可。
当这发生在我身上我通过重置约束来修复它,或者我把它留给XCOde建议来应用约束 – meda 2014-12-03 08:25:33
是的,谢谢你的建议。虽然,当涉及到屏幕按钮上的查看(Height-Equals TrailingSpace,LeadingSpace,bottomSpace)时,该建议不起作用。 – Jenny 2014-12-03 08:47:24