【自动布局Guide】
@interface UIViewController (UILayoutSupport)
//自动布局的时候,以考虑 bar 的高度。 把下面两个看成bar 的view
@property(nonatomic,readonly,retain) id<UILayoutSupport> topLayoutGuide NS_AVAILABLE_IOS(7_0);
@property(nonatomic,readonly,retain) id<UILayoutSupport> bottomLayoutGuide NS_AVAILABLE_IOS(7_0);
UIView *topView = (UIView *)self.topLayoutGuide;
UIView *bottomView = (UIView *)self.bottomLayoutGuide;
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(topView.mas_bottom).mas_offset(10);
make.left.and.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(bottomView.mas_top).mas_offset(-10);
}];
@end