如何解决如何处理嵌套的UITableViews上的手势识别器?
我有一个表,该表包含内部具有一个嵌套表的单元格(注释-答复场景)。
父表视图具有两个附加的手势识别器(点击和长按)。同样适用于其内部的每个子表视图。我将两个手势识别器分配给整个表而不是每个单元格,然后使用location
确定哪个单元格触发了手势。主表视图由控制器处理,每个单元格都处理自己的表视图。
我注意到有时手势识别器会发生“冲突”,这意味着我长按了一个属于子表之一的单元格,就会从父表视图中调用手势识别器。
是否有建议的方法可以防止这种情况发生?
下面是我目前的布局示意图:
Main UITableView with 2 gesture recognizers
|------------------------------------|
| |
| Cell #1 on main table |
| |
| Nested UITableView inside cell #1 |
| with 2 gesture recognizers |
| ---------------------------------- |
| | Cell #1 on nested table | |
| |--------------------------------| |
| | Cell #2 on nested table | |
| |--------------------------------| |
| | Cell #3 on nested table | |
| |--------------------------------| |
| |
|------------------------------------|
| |
| Cell #2 on main table |
| |
| Nested UITableView inside cell #2 |
| with 2 gesture recognizers |
| ---------------------------------- |
| | Cell #1 on nested table | |
| |--------------------------------| |
| | Cell #2 on nested table | |
| |--------------------------------| |
| | Cell #3 on nested table | |
| |--------------------------------| |
| |
|------------------------------------|
谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。