美文网首页
textView内容监听来伪装placeholder文字

textView内容监听来伪装placeholder文字

作者: 就是爱吃肉 | 来源:发表于2017-03-23 16:34 被阅读0次

#pragma mark - UITextViewDelegate

- (void)textViewDidEndEditing:(UITextView *)textView

{

if(textView.text.length < 1){

textView.text = @"反馈内容";

contentTextView.font = [UIFont systemFontOfSize:[CalculateFrameView setHeight:16]];

contentTextView.textColor = [UIColor grayColor];

}

}

- (void)textViewDidBeginEditing:(UITextView *)textView

{

if([textView.text isEqualToString:@"反馈内容"]){

textView.text=@"";

contentTextView.font = [UIFont systemFontOfSize:[CalculateFrameView setHeight:16]];

contentTextView.textColor = [UIColor blackColor];

}

}

相关文章

网友评论

      本文标题:textView内容监听来伪装placeholder文字

      本文链接:https://www.haomeiwen.com/subject/seltottx.html