iOS:滑动手势有时有效,有时无效

时间:2015-02-02 09:25:23

标签: ios objective-c uilabel uiswipegesturerecognizer

我已经以编程方式在标签上添加了一个滑动手势。

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

标签是我必须应用滑动的标签,究竟是什么问题?怎么解决?

0 个答案:

没有答案