微博项目开发过程中,对UIImageView做手势添加功能,
// 给CFPhotoView添加手势
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] init];
// 设置手势触碰事件
[recognizer addTarget:self action:@selector(onClickWithPhoto:)];
// 为CFPhotView设置手势
[photoView addGestureRecognizer:recognizer];
之间遇到手势点击无效果,然后又给控件本身设置了用户交互操作
self.userInteractionEnabled = YES;
结果还是没有效果,又给控件的外部控件添加了交互属性,最后才能点击效果。这点切记