[英]iOS: UITableView inside UITableViewCell with dynamic cell height
[英]UITableView inside a UITableViewCell in iOS
在 UITableViewCell 中垂直滚动会有点奇怪和复杂,因为您也可以在普通表格视图中滚动。 根据附加项目的数量设置单元格的高度对您来说不是更好的解决方案吗? 一个伪例子:
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return cell.attachedItems.count * 50
}
然后带有更多附加项目的单元格会更大,您可以保持正常的表格视图滚动流。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.