iOS textview中设置键盘类型却换行的问题
2020-10-22 本文已影响0人
90后的晨仔
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if ([text isEqualToString:@"\n"]) {
[textView resignFirstResponder];
return NO;
}
return YES;
}