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

posted @ 2013-10-31 13:38  cocoajin  阅读(278)  评论(0编辑  收藏  举报