在另一个嵌套表中嵌套 UITableView [英] Nested UITableView inside another nested table

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

问题描述

我正在开发一个最初显示表格的应用程序.您点击表格中的一个单元格,该单元格展开,在单元格内显示一个表格视图.为此,我在自定义 UITableViewCell 中实现了 UITableView 委托.我现在想在第二个表格视图中的单元格上进行选择以展开单元格并显示另一个表格(两个级别下降).这可能吗?我会在选择时创建一个表格(自定义单元格类中的 didSelectRowAtIndexPath )吗?我会把表格方法放在哪里?

I am developing an app that initially displays a table. You tap a cell in the table and the cell expands, showing a table view inside the cell. To do this I implemented the UITableView delegate inside the custom UITableViewCell. I would like to now have a selection on a cell in the second table view to expand the cell and show another table (two levels drop). Is this possible? Would I just create a table on selection (didSelectRowAtIndexPath in the custom cell class)? Where would I put the table methods for it?

推荐答案

重要提示:您不应在 UIScrollView 对象中嵌入 UIWebView 或 UITableView 对象.如果这样做,可能会导致意外行为,因为两个对象的触摸事件可能会混淆并错误处理.来源

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled. source

作为 UITableViews 的子类 UIScrollViews,这也适用于此.

As UITableViews subclasses UIScrollViews this applies here too.

您可以通过使用部分标题视图的咖啡显示视图和选项的自定义单元格来实现您想要的.
或者使用自定义单元格显示咖啡视图和选项页脚视图.

What you want can be achieved by using section header views for the coffee displaying view and custom cells for the options.
Or using custom cells for he coffee views and section footer views for the options.

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

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