在UITableViewCell中添加UITableView [英] adding UITableView inside UITableViewCell

查看:131
本文介绍了在UITableViewCell中添加UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理自定义 UITableViewCell 我要在 UITableViewCell <中添加 UITableView / code>所以有任何控制器可以做同样的事情

I am working on custom UITableViewCell where I want to add UITableView inside UITableViewCell so is there any controller available to do the same

这是我要在项目中添加的图像

This is the image of what I want to add in my project

这是可扩展的 UITableView 其中点击表格中的第一行后按钮被展开。

This is expandable UITableView where after clicking first row inside table and buttons are expanded.

所以如果任何类似的控制器都可以,请建议我。

So if any similar controller is available please suggest me.

提前致谢。

推荐答案

Apple不建议将表视图添加为其他可滚动对象的子视图。
如果你想开发这样的东西,可以采取以下步骤:

Apple does not recommend table views to be added as subviews of other scrollable objects. If you want to develop such thing, here are the steps for you:


  1. 为桌面视图单独制作部分在表格视图中

  2. 该部分的第一行 - 您的可点击行

  3. 当用户触摸某行时,通过<$ c $处理它c> - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

  4. 通过修改数据源数组将其他单元格插入此部分。

  5. 重新加载部分或进行更新,

  1. Make separate section for your 'table view' inside your table view
  2. The first row of the section - your clickable row
  3. When the user touches a row, handle it via - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath.
  4. Insert other cells into this section by modifying your datasource array.
  5. Reload section or do an update,

as

[self.dataSourceArray insertObject:object atIndex:indexPath.row];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];


这篇关于在UITableViewCell中添加UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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