如何实现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];
再次,它不起作用!我真的很想知道,即使未启用多点触摸,为什么表视图也会响应两指滑动!
没有找到相关结果
已邀请:
1 个回复
疮痪徘弦漏