改换行为完成
textView.keyboardType = UIKeyboardAppearanceDefault;
textView.returnKeyType = UIReturnKeyDone;
点击完成不输入\n
textView.delegate = self;
- (BOOL)textView:(YYTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if ([text isEqualToString:@"\n"]){
[self.view endEditing:YES];
return NO;
}
return YES;
}
网友评论