2014-12-03 72 views
3

的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

回答

6

我已經解決了這個問題。選擇BottomSpaceToBottomLayoutGuide約束的底部。

enter image description here

+0

謝謝!解決了我的問題! :) – Georg 2015-08-17 07:07:26

+1

隱藏在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

0

@珍妮的做法,現在被隱藏在Xcode 7,但你可以打開你的故事板的源代碼,發現這個約束,並手動將其設置爲「底部」。爲了簡化搜索,只需從Identity Inspector中複製ObjectID即可。