В настоящее время у меня есть пользовательский UITableViewCell, который содержит UIImageView и пытается добавить UITapGestureRecognizer в UIImageView без везения. здесь приведен фрагмент кода.
//within cellForRowAtIndexPath (where customer table cell with imageview is created and reused)
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)];
tap.cancelsTouchesInView = YES;
tap.numberOfTapsRequired = 1;
tap.delegate = self;
[imageView addGestureRecognizer:tap];
[tap release];
// handle method
- (void) handleImageTap:(UIGestureRecognizer *)gestureRecognizer {
RKLogDebug(@"imaged tab");
}
Я также установил userInteractionEnabled в ячейку и супервизор UIImageView, но все равно не повезло, никаких подсказок?
ИЗМЕНИТЬ:
Я также удаляю выбор ячейки по ячейке .selectionStyle = UITableViewCellSelectionStyleNone; Это может быть проблемой