通过以下的方法可以使UIimageVIew获得点击事件。可如果当前画面有复数个VIew且无法判断我点击是哪个view的时候怎么办呢
for (UIImageView *newImageView in ConditionArr) {
[newImageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(conditionSelected:)]];
[newImageView setUserInteractionEnabled:YES];
}
用这个办法
- (void) conditionSelected:(UITapGestureRecognizer*)sender{
[sender view].backgroundColor = [UIColor blackColor];
}