我已经以编程方式在标签上添加了一个滑动手势。
swipe =
[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(slideToRightWithGestureRecognizer:)];
swipe.direction = UISwipeGestureRecognizerDirectionLeft;
[self.discountLabel setUserInteractionEnabled:YES];
[self.discountLabel addGestureRecognizer:swipe];
但是当我尝试在标签上滑动时会发生什么,在前3-4次滑动时它不起作用,突然在另一次尝试它起作用。滑动不顺畅。我还包括
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
我的视图层次结构是,
---> View
|
---> SubView - A
|
---> SubView - B
|
---> Label
标签是我必须应用滑动的标签,究竟是什么问题?怎么解决?