0

this is my code:

  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); use frame, it's ok!

        [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;
    });

error log:

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

1 Answers1

0

try to replace all code from class ZLDropDownMenu in library to your class ZLDropDownMenu in project. It helps me