开发者

UITableView and UIGestureRecogniser

I have a UITableView with normal vertical scrolling.

I want to add a UISwipeGestureRecnogiser to it (or somewhere connected in the view hierarchy).

I've done this, but the vertical tolerance on my gesture recogniser is pretty small. So I have to get my horizontal swipe p开发者_Python百科retty straight, otherwise the UITableView takes over and scrolls vertically. This is pretty annoying for the user.

Has anyone got any suggestions on how to better handle this? Maybe putting a UIView on top of my table view that handles the gesture, but if it fails - somehow pass the event to my table View.....


I ended creating my own gesture recogniser - following the example from the event handling guide for iOS.

I had more control over vertical tolerance using the old touchesMove and touchesBegan.

It still wasn't perfect, but it was a lot better and after testing on a few people, I could see there the swiping was less error prone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜