UIscrollView中的UILabel无法识别UISwipegesture

时间:2014-05-28 05:33:16

标签: ios xcode uiscrollview uiswipegesturerecognizer

code:
lblQuestion = [[UILabel alloc]initWithFrame:CGRectMake(23, intQuesPos, 280, 100)];
    lblQuestion.numberOfLines = 0;
    UISwipeGestureRecognizer *topGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeToptoBottom)];
    [topGesture setDirection:UISwipeGestureRecognizerDirectionDown];
    [lblQuestion addGestureRecognizer:topGesture];
    [scrollQuestion addSubview:lblQuestion];
    [vwQuestion addSubview:scrollQuestion];

我在UILabel中有UIScrollView,我向UISwipegesture添加了UILabel。当我向下滑动时只检测到UISCrollView

任何帮助将不胜感激。

提前致谢

1 个答案:

答案 0 :(得分:1)

使标签

的userInteractionEnabled为true
    lblQuestion.userInteractionEnabled=YES;