简体   繁体   中英

UITableView inside a UITableViewCell in iOS

Hello I want to create a UITableviewCell like this.

在此处输入图片说明

There can be 1 or more attached documents.How can I show attached documents if there are more than 1 documents.

Can I use a A UITableview inside the UITableViewCell ? 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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