textView内容监听来伪装placeholder文字

#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文字)