Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须创建一个应用程序,其中包含与 Facebook iPhone 应用程序相同类型的视图 - 配置文件视图和墙部分。我的要求是有一个问题,用户可以给出不限行数的答案。所以很明显我必须使用 UITableView。现在我的问题是确定我的表格行高是否有两行。答案部分应该很小,如果答案部分很大,那么它应该很大,答案是无限的。
有谁知道如何创建这种类型的表格视图?
听起来你会想要实施
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
在你的 UITableViewDelegate 中。您需要计算各行的高度,然后在上述函数中返回这些高度。