【发布时间】:2013-12-20 14:33:20
【问题描述】:
我有 UITableView,每个 tableViewCell 都是自定义的。在我的 customTableViewCell 内部是一个 UITextView,TextViews 框架是 pin 或与其 superView 相同,即 tableViewCell。
我将如何动态设置与 TextViews 大小成正比的 UITableViewCell 高度,这也取决于我从互联网上获得的内容文本。
(样品原型)
// 这就是我操作每个单元格高度的方式
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
// How do I set the height here, whats the best approach for this. with autolayout BTW
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// I initialize every cell here with my ArrayContainer, nothing much to refer here.
}
【问题讨论】:
标签: ios objective-c uitableview autolayout