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

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

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

}

 

 

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-12-12
  • 2021-06-24
  • 2021-05-25
猜你喜欢
  • 2021-05-12
  • 2021-09-01
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案