我试图在UIImageview中添加一个tapgesture。但是我现在正在使用的代码不起作用。
我已将此添加到我的viewdidload中(注意LabelNewsImage是我的UIImageview):
LabelNewsImage.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGestureEnlarge = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)];
tapGestureEnlarge.numberOfTapsRequired = 1;
[self.LabelNewsImage addGestureRecognizer:tapGestureEnlarge];