【发布时间】:2010-11-11 14:16:35
【问题描述】:
我在谷歌上搜索这个,但我总是找到非常复杂的解决方案。我有一个带有不可编辑的可滚动 UITextView 的单元格,我只想将该单元格的高度增加到一个恒定值。我该怎么做?实际上我正在使用下一个代码将 UITextView 添加到单元格中。
cell.contentView.bounds = CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height);
UITextView *textView = [[UITextView alloc] initWithFrame:cell.contentView.bounds];
textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
textView.editable = NO;
textView.scrollEnabled = YES;
textView.backgroundColor = [UIColor clearColor];
textView.text = self.description;
[cell.contentView addSubview:textView];
[textView release];
感谢阅读。
【问题讨论】:
标签: objective-c ios uitableview