【问题标题】:UILabel in UIscrollView does not recognize UISwipegestureUIscrollView 中的 UILabel 无法识别 UISwipegesture
【发布时间】:2014-05-28 05:33:15
【问题描述】:
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];

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

任何帮助将不胜感激。

提前致谢

【问题讨论】:

    标签: ios xcode uiscrollview uiswipegesturerecognizer


    【解决方案1】:

    为标签设置 userInteractionEnabled 为真

        lblQuestion.userInteractionEnabled=YES;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多