【问题标题】:Masonry: topLayoutGuide/bottomLayoutGuide cause crash in iOS9砌体:topLayoutGuide/bottomLayoutGuide 在 iOS9 中导致崩溃
【发布时间】:2015-12-13 18:05:12
【问题描述】:

砌体: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);
}];

【问题讨论】:

    标签: autolayout ios9 masonry


    【解决方案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);
    }]
    

    【讨论】:

      猜你喜欢
      • 2015-12-09
      • 2018-01-14
      • 2016-01-20
      • 1970-01-01
      • 2015-11-02
      • 2016-07-06
      • 1970-01-01
      • 2019-02-04
      相关资源
      最近更新 更多