search

Home  >  Q&A  >  body text

ios - 使用Masonry 报NSInternalInconsistencyException错误

伊谢尔伦伊谢尔伦2768 days ago713

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 16:57:35

    make.top.mas_equalTo(weakSelf.view).width.offset(200);

    not width, but with

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 16:57:35

    The difference between mas_equalTo and equalTo needs to be noted

      [self.view addSubview:btn];
      [self.view addSubview:btn1];
        __weak __typeof(&*self)weakSelf = self;
        [btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(100, 50));
            make.left.equal(weakSelf.view).offset(200);
            make.top.equal(weakSelf.view).offset(200);
        }];
        [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(100, 100));
            make.left.equal(weakSelf.view).with.offset(50);
            make.top.equal(weakSelf.view).width.offset(200);
        }];

    reply
    0
  • 阿神

    阿神2017-04-17 16:57:35

    I actually wrote “with” as “width” and I just fell to my knees.

    reply
    0
  • Cancelreply