简体   繁体   English

iOS 中 UITableViewCell 内的 UITableView

[英]UITableView inside a UITableViewCell in iOS

Hello I want to create a UITableviewCell like this.你好,我想创建一个这样的UITableviewCell

在此处输入图片说明

There can be 1 or more attached documents.How can I show attached documents if there are more than 1 documents.可以有 1 个或多个附件。如果有 1 个以上的文件,我如何显示附件。

Can I use a A UITableview inside the UITableViewCell ?我可以在UITableViewCell使用A UITableview吗? If so how?如果是这样怎么办? What is the best way that I can achieve this?我可以实现这一目标的最佳方法是什么?

Please help me.请帮我。 Thanks谢谢

A vertical scrolling inside a UITableViewCell would be kind of strange and complicated because you can also scroll in the normal table view.在 UITableViewCell 中垂直滚动会有点奇怪和复杂,因为您也可以在普通表格视图中滚动。 Wouldn´t it be a better solution for you to set the height of the cell depending on the number of attached items.根据附加项目的数量设置单元格的高度对您来说不是更好的解决方案吗? One pseudo example:一个伪例子:

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {

    return cell.attachedItems.count * 50
}

Then a cell with more attached items would be bigger and you could keep the normal table view scrolling flow.然后带有更多附加项目的单元格会更大,您可以保持正常的表格视图滚动流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM