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
。
任何帮助将不胜感激。
提前致谢
答案 0 :(得分:1)
使标签
的userInteractionEnabled为true lblQuestion.userInteractionEnabled=YES;