我创建UIViewController
并Storyboard
添加tableview
为Subview
. 它工作正常。我以tableview
编程方式添加了单元格,每个单元格都包含UITextFields
or UITextView
。UITextFields
工作正常。但是UITextViews
有一些麻烦。EX:当我添加文本时,UITextView
波纹管UITextViews
重叠。这是为什么 ?我试图整理一整天。但我还是做不到。:(
case cellResponseNote:
cell = [tableView.tableView dequeueReusableCellWithIdentifier:CellIdentifierResponseNote];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifierResponseNote];
cell.frame = CGRectMake(0, 0, cell.frame.size.width, cellNotesHeight);
//cell.frame = CGRectMake(0, 0, cell.frame.size.width, cellNotesHeight);
if (!self.txtVwResponseNote) {
// self.txtVwResponseNote = [[UITextView alloc] initWithFrame:cell.frame];
self.txtVwResponseNote = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, cellNotesHeight)];
[self.txtVwResponseNote setScrollEnabled:NO];
[self.txtVwResponseNote setAutoresizingMask:UIViewAutoresizingNone];
[self.txtVwResponseNote setDelegate:self];
[self.txtVwResponseNote setFont:[UIFont systemFontOfSize:14]];
[self.txtVwResponseNote setInputAccessoryView:self.keyboardToolbar];
[self setupMailData:indexPath.row];
}
}
self.txtVwResponseNote.editable = !(self.isMailForReview);
// [cell.contentView addSubview:self.txtVwResponseNote];
[cell addSubview:self.txtVwResponseNote];
contentSubview = self.txtVwResponseNote;
在此图像底部,您可以看到三个单元格。(波纹管页脚)当我为顶部文本视图添加文本值时。然后重叠下一个文本视图。波纹管图像你只能看到两个文本视图。底部文本视图未显示。
所以我该怎么做 ?