实现他的一个协议方法即可
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
if ([text isEqualToString:@"\n"]){
[textView resignFirstResponder];
return NO;
}
return YES;
}
实现他的一个协议方法即可
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
if ([text isEqualToString:@"\n"]){
[textView resignFirstResponder];
return NO;
}
return YES;
}