[英]Adding tapgesture to UIImageview
我试图给UIImageview添加一个手势。 但是我现在使用的下面的代码无法正常工作。
我已经将其添加到我的viewdidload中(注意LabelNewsImage是我的UIImageview):
LabelNewsImage.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGestureEnlarge = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)];
tapGestureEnlarge.numberOfTapsRequired = 1;
[self.LabelNewsImage addGestureRecognizer:tapGestureEnlarge];
响应选择器tapGesture:您编写的方法是否可能像
- (void)tapGesture
{
// TODO:
}
但它应该像这样
- (void)tapGesture:(NSDictonary *)dic
{
// TODO:
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.