如何解决如何实现UITableView向下方向的滑动手势?
| 我尝试了以下代码:UISwipeGestureRecognizer *showBar = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(gestureShowBar:)];
showBar.direction = UISwipeGestureRecognizerDirectionDown;
showBar.numberOfTouchesRequired = 2;
[self.tableview addGestureRecognizer:showBar];
没有运气!当我用两根手指滑动时,tableview倾向于滚动。因此,我尝试在tableview上禁用多点触摸,然后让superview处理手势:
UISwipeGestureRecognizer *showBar = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(gestureShowBar:)];
showBar.direction = UISwipeGestureRecognizerDirectionDown;
showBar.numberOfTouchesRequired = 2;
[self.view addGestureRecognizer:showBar];
再次,它不起作用!我真的很想知道,即使未启用多点触摸,为什么表视图也会响应两指滑动!
解决方法
此链接描述了如何在表格行中实现捏合手势,您可以调整滑动手势来代替
检出存在夹点方法的tableviewcontroller类
http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010139
祝好运
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。