Autolayout 问题

2016-01-04  本文已影响48人  _健健

1.tableHeaderView:

translatesAutoresizingMaskIntoConstraints 这个属性如果设置为NO,iOS7下会crash,

如果为YES,iOS8下布局又会出现问题。

解决方案1:

if([[UIDevicecurrentDevice]systemVersion].floatValue>=8.0){

headerView.translatesAutoresizingMaskIntoConstraints=NO;//ios7_crash

}

解决方案2:

if([[UIDevicecurrentDevice]systemVersion].floatValue>=8.0){

WS(wSelf);

[self.headerView mas_makeConstraints:^(MASConstraintMaker*make) {

make.width.equalTo(wSelf.view);

}];

}

上一篇 下一篇

猜你喜欢

热点阅读