【发布时间】:2010-04-30 11:45:49
【问题描述】:
我有一个自定义 UITableViewCells 的 UITableView,如下所示:
[ CELL 0
[ description ]
[ dynamic content type 1 ]
[ dynamic content type 2 ]
[ dynamic content type 3 ]
]
[ CELL 1
[ description ]
[ dynamic content type 1 ]
[ dynamic content type 3 ]
]
[ CELL 2
[ description ]
[ dynamic content type 2 ]
]
[ ... and so on ... ]
由于 [description] 部分已经相当复杂,我决定使用 Interface Builder 来设计它,并使用 [cell addSubview:...] 以编程方式在 cellForRowAtIndexPath 中添加 [动态内容]。我现在的问题是,我在 Interface Builder 中为我的自定义 UITableViewCell 设置了默认高度,但是当我添加我的 [动态内容](可能介于 0..3 之间)时,我有不同高度的不同单元格。
当然要计算总高度并更改heightForRowAtIndexPath 中的返回值,但是如何更改我的实际cell 的高度值(从具有固定高度的nib 文件加载) ?
【问题讨论】:
标签: iphone uitableview