Masonry:topLayoutGuide / bottomLayoutGuide导致iOS9崩溃
演示代码:
[topView makeConstraints:^(MASConstraintMaker *make) {
UIView *topLayoutGuide = (id)self.topLayoutGuide;
// topLayoutGuide cause exception
make.top.equalTo(topLayoutGuide.mas_bottom);
make.left.equalTo(self.view);
make.right.equalTo(self.view);
make.height.equalTo(@40);
}];
答案 0 :(得分:1)
我认为您应该使用self.mas_topLayoutGuide
,因为self.topLayoutGuide
不是UIView对象。
[topView makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_topLayoutGuide);
make.left.equalTo(self.view);
make.right.equalTo(self.view);
make.height.equalTo(@40);
}]