这是我的代码:
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);使用frame,没问题!
[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发布于 2016-12-23 16:36:32
尝试将库中类ZLDropDownMenu中的所有代码替换为项目中的类ZLDropDownMenu。这对我有帮助
https://stackoverflow.com/questions/35954933
复制相似问题