我尝试将点击添加到 UIImageView,如下所示,但它不起作用!_img_compass_text_background是UIImageView
我发现另一个视图覆盖了我的视图,但大部分顶视图都是完全透明的,我怎样才能强制水龙头通过它?
换句话说,我怎样才能禁止视图使用水龙头?
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(locationNameTapped)];
tapGestureRecognizer.numberOfTapsRequired = 1;
_img_compass_text_background.userInteractionEnabled=YES;
[_img_compass_text_background addGestureRecognizer:tapGestureRecognizer];