У меня есть UITextView внутри пользовательского UITableViewCell.Проблема, с которой я столкнулся, связана с resignFirstResponder.Когда вызывается resignFirstResponder и UIkeyboard отклоняется, UITextView прокручивается вверх на одну строку, что делает ввод только наполовину видимым вверху ячейки.
Я что-то пропустил в следующем коде при создании UITextView?
if (indexPath.row == 0) {
// Load the cell with the comment textView
cell = (DetailCellViewController *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier3];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"DetailCellView3"
owner:nil
options:nil];
for (id currentObject in topLevelObjects) {
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (DetailCellViewController *) currentObject;
break;
}
}
}
self.textView = [[UITextView alloc] initWithFrame:cell.contentView.bounds];
self.textView.backgroundColor = [UIColor clearColor];
self.textView.textColor = [UIColor blackColor];
self.textView.returnKeyType = UIReturnKeySend;
self.textView.enablesReturnKeyAutomatically = YES;
self.textView.editable = YES;
self.textView.scrollEnabled = YES;
self.textView.opaque =YES;
self.textView.clipsToBounds = YES;
self.textView.autocorrectionType = UITextAutocorrectionTypeNo;
self.textView.delegate = self;
self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[cell.contentView addSubview:textView];
[textView release];
return cell;