0

这是我的代码:

  UIView *nameRightView = ({
    UIView *nameRightView = [[UIView alloc] init];
    nameRightView.bounds = CGRectMake(0, 0, 100, 34);
    nameRightView.backgroundColor = [UIColor redColor];
    nameTextField.rightView = nameRightView;
    nameTextField.rightViewMode = UITextFieldViewModeAlways;

    UIImageView *closeIv = ({
        UIImageView *closeIv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"subscribe_match_filter_delete_hover"]];

// closeIv.frame = CGRectMake(7, 0, 34, 34); 用框架,没关系!

        [nameRightView addSubview:closeIv];
        [closeIv mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(nameRightView.mas_top);
            make.right.equalTo(nameRightView.mas_right).width.offset(7);
            make.bottom.equalTo(nameRightView.mas_bottom);
            make.width.equalTo(@34);
        }];

        closeIv;
    });

错误日志:

*** Assertion failure in -[MASViewConstraint addConstraintWithLayoutAttribute:], /Users/donglei/Documents/Ios/BMLOL4.4.0/Pods/Masonry/Masonry/MASViewConstraint.m:207
4

1 回答 1

0

尝试将库中 ZLDropDownMenu 类中的所有代码替换为项目中的 ZLDropDownMenu 类。它帮助到我

于 2016-12-23T08:36:32.303 回答