textView使用总结
1.处理textView的return事件
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if (1 == range.length) { //空格
return YES;
}
if ([text isEqualToString:@"\n"]) { //return
[textView resignFirstResponder];
return NO;
}
return NO;
}