_textView = [[UITextView alloc]init];
_textView.backgroundColor = [UIColor whiteColor];
_textView.delegate = self;
[cell.contentView addSubview:_textView];
[_textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
_placeholdeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bottlefive.png"]];
[cell.contentView addSubview:_placeholdeView];
[_placeholdeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.bottom.mas_equalTo(-10);
make.size.mas_equalTo(CGSizeMake(282/3, 282/3));
}];
_addView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dgn-gr-grz-bj3@3x.png"]];
[_addView addTapGestureRecognizerWith:self action:@selector(clickaddView:)];
[cell.contentView addSubview:_addView];
[_addView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(_placeholdeView.mas_right).offset(10);
make.bottom.mas_equalTo(-10);
}];
_placeholerLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 40)];
_placeholerLabel.textAlignment = NSTextAlignmentLeft;
_placeholerLabel.font = [UIFont systemFontOfSize:14];
_placeholerLabel.text = @"请输入内容";
[_textView addSubview:_placeholerLabel];
-(void)textViewDidChange:(UITextView *)textView{
if (textView.text.length ==0) {
_placeholerLabel.text = @"请输入内容";
}
else{
_placeholerLabel.text=@"";
}
}