我们可以将tableview添加到单元格吗? [英] Can we add tableview to cell?

查看:23
本文介绍了我们可以将tableview添加到单元格吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自定义我的 tableview.我想在单元格中添加另一个 tableview.我们可以在另一个 tableview 的单元格中添加 tableview 吗?

I want to customize my tableview. I want to add another tableview in cell. Can we add tableview in cell of another tableview?

请给我一些想法.

推荐答案

将一个 UITableView 添加到一个 UITableViewCell 中是没有问题的,因为它们都是 UIView 的它简单地会被翻译成添加视图的子视图...

There is no problem with adding a UITableView into a a UITableViewCell, since both of them are UIViews its simply would be translated to adding a subview to a view...

但是,请记住考虑以下问题:

However, keep in mind to consider the following issues:

1- 从用户体验的角度来看,这将是另一个垂直滚动视图内的垂直滚动视图(您同意吗?).

1- From a user experience perspective, that would be a vertical scroll view inside another vertical scroll view (are you ok with that?).

2- 对于主容器表视图中的每个单元格,您需要处理表视图委托/数据源.要了解如何做到这一点的逻辑,您可能需要检查:

2- For each cell -in the main container table view-, you would need to handle the table view delegates/datasources. For understanding the logic of how this could be done, you might want to check:

  • Is it possible to add UITableView within a UITableViewCell.
  • Putting a UICollectionView in a UITableViewCell in Swift: although it is about adding a UICollectionView inside the cell, it helps to gain the logic of how to achieve such a task.

这篇关于我们可以将tableview添加到单元格吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆