嗨如何将返回键设置为下面的 UITextView 的新行?谢谢
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if (range.length == 0) {
if ([text isEqualToString:@"\n"]) {
[textView resignFirstResponder];
NSIndexPath *path = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView scrollToRowAtIndexPath:path atScrollPosition:UITableViewScrollPositionTop animated:YES];
[self.tableView setScrollEnabled:NO];
return NO;
}
}
return YES;
}