iOS UILongPressGestureRecognizer

2019-12-18  本文已影响0人  雪丹妮_66865

UILongPressGestureRecognizer *longGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longGestureAction:)];
longGesture.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:longGesture];

其实是因为响应状态的不同。所以,要在你的方法里面加上状态的判断。

上一篇 下一篇

猜你喜欢

热点阅读