UITextView 添加 pleaceholder

UITextView 默认没有 pleaceholder属性;

我们可以通过多种方式添加

在UITextView的代理方法中写

- (void)textViewDidBeginEditing:(UITextView *)textView
{
    if ([textView.text isEqualToString:@"建议字数在300字左右"]) {
        textView.text = @"";
        textView.textColor = [UIColor blackColor]; //optional
    }
    [textView becomeFirstResponder];
}

参考:http://stackoverflow.com/questions/1328638/placeholder-in-uitextview

原文地址:https://www.cnblogs.com/cocoajin/p/3399134.html