简体   繁体   English

我需要在页面控件中的tableView上检测到滑动手势,该怎么办?

[英]I need to detect a swipe gesture on my tableView that is within a page control, how can I do this?

Pretty straight forward, I just can't get it to work. 非常简单,我无法正常工作。 What can I do to swipe to delete on my tableView that is within a page control? 如何在页面控件内的tableView上滑动以进行删除?

Please help! 请帮忙!

Edited to remove my original answer regarding the proper UITableViewDataSource methods. 编辑以删除有关适当的UITableViewDataSource方法的原始答案。

This sounds like a potentially complicated user interface (ie if users are expecting swipes to turn a page but if they mis-touch and hit the table view cell just right, they'll get the "delete" button). 这听起来像一个潜在的复杂用户界面(即,如果用户希望滑动即可翻页,但是如果他们误触摸并恰好击中了表格视图单元,则将获得“删除”按钮)。 I'd suggest re-thinking what you are doing. 我建议您重新考虑您的工作。

In any event, to get to the finish line on your app might be to subclass UIPageControl, detect when swipes are happening in the content region and pass that swipe message along to the table view. 无论如何,要到达应用程序的终点, 可能是子类化UIPageControl,检测内容区域中何时发生滑动并将该滑动消息传递到表格视图。 I suspect you can't just do userInteractionEnabled = NO; 我怀疑你不能只做userInteractionEnabled = NO; on the page control's content view. 在页面控件的内容视图上。

FYI: you should also probably delete the identical & duplicate question you posted a number of hours before the question I'm attempting to answer ( How can I capture a sideways swipe gesture for a tableView that is inside of a pageControl? ) 仅供参考:您可能还应该删除在我试图回答的问题之前几个小时发布的相同且重复的问题( 如何捕获pageControl内的tableView的横向滑动手势?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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