Push Storyboard
按鈕事件Push
到最後一個頁面。 Back
Button先從Tab Bar
(此時已經隱藏了)的頂部,而後回到底部。 用爲代碼描述,大概是經歷了ios
back.bottomConstraint.constant = -tabbarHeight;
back.bottomConstraint.constant = 0.0f;
複製代碼
iOS 10.3.3
Storyboard
佈局Back
Button佈局Hide Bottom Bar on Push: YES
這裏是他們的看法bash
Safe Area
是iOS 11
的特性,對iOS 10
支持得不太好(< iOS 11
估計都有問題),須要作適配。佈局
但奇怪的是,我還沒發現Safe Area Top
須要適配,顯然Safe Area Bottom
須要。ui
底部約束Safe Area
都改爲Superview
atom
而後綁定約束爲屬性,代碼適配,代碼像這樣spa
@interface YourViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomConstraint;
@end
@implementation YourViewController
- (void)viewDidLoad {
[super viewDidLoad];
CGFloat bottomValue = 0.0f; // your value
UIEdgeInsets edgeInsets = UIApplication.sharedApplication.keyWindow.layoutMargins;
CGFloat bottomInset = edgeInsets.bottom;
self.bottomConstraint.constant = - bottomInset - bottomValue;
}
@end
複製代碼
爲啥不用直接Storyboard
適配,由於Storyboard
沒辦法搞這種適配,多是我沒找到,有的話告訴我❤️code