欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iOS UIImageView用代码添加点击事件

程序员文章站 2024-01-15 19:05:34
...
image.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imagePressed:)];
[image addGestureRecognizer:tap];