优先滑动以删除竞争的滑动手势 [英] Prefer swipe to delete over a competing swipe gesture

查看:68
本文介绍了优先滑动以删除竞争的滑动手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在 XLPagerTabStrip 视图控制器中有一个tableViewController,基本上是一个可让我在子视图控制器左右.问题是当用户在tableView的单元格上滑动时,我想禁用视图控制器滚动.在这种情况下,我希望他能够看到delete选项,而不是更改viewController本身.这可能吗?当前,只有真正,非常快速地滑动并且在所有其他情况下,整个viewController都会被滑动,我才能看到删除按钮.

So I have a tableViewController inside a XLPagerTabStrip view controller, basically a pod which allows me to swipe between child view controllers left and right. The problem is that I want to disable the view controller scroll when the user swipes on a cell on my tableView. In this case I want him to be able to see the delete option, instead of changing the viewController itself. Is this possible? Currently, I see the delete button only if I swipe really, really fast and in all other scenarios, the entire viewController is swiped away.

推荐答案

我不认为UIGestures有任何种类的首选项属性.相反,我相信规则是添加的第一个手势优先.但是,在特定情况下使用XLPagerTabStrip,您可以简单地在'containerView'(UIScrollView的子类)的界面构建器中禁用滚动.无论如何,这为我解决了问题,让我的孩子正确查看了控制器的UITableViews动作.

I don't believe there is any sort of preference property for UIGestures. Instead, I believe the rule is the first gesture added takes precedent. However, in your specific circumstance with XLPagerTabStrip, you can simply disable scrolling in the interface builder for your 'containerView' (subclass of UIScrollView). That solved the problem for me anyway, having my children view controllers' UITableViews actions appearing correctly.

这篇关于优先滑动以删除竞争的滑动手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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