zoukankan      html  css  js  c++  java
  • iOS 监听UILabel点击

     label.userInteractionEnabled = YES; // 一定要设置
     [label addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelClick:)]];

    - (void)labelClick:(UITapGestureRecognizer *)tap{

        NSLog(@"%@",tap.view);

    }

     
  • 相关阅读:
    3-8
    3-7
    3-5
    3-4
    3-3
    3-2
    3-1
    2-11
    2-10
    2-9
  • 原文地址:https://www.cnblogs.com/xsphehe/p/6397636.html
Copyright © 2011-2022 走看看