xxxxTextView = [[UITextViewalloc]initWithFrame:CGRectMake(1,2,View_width-2,200)];
xxxxTextView.delegate=self;
xxxxTextView.text=@"您的意见(选填)";
xxxxTextView.textColor = [UIColorlightGrayColor];//optional
-(void)textViewDidBeginEditing:(UITextView *)textView{
if ([textView.textisEqualToString:@"您的意见(选填)"]) {
textView.text = @"";
textView.textColor = [UIColorblackColor]; //optional
}
[textView becomeFirstResponder];
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
if ([textView.textisEqualToString:@""]) {
textView.text = @"您的意见(选填)";
textView.textColor = [UIColorlightGrayColor];//optional
}
[textView resignFirstResponder];
}