3 hours of wasted time on this issue.
A description of the problem
There are two Uiimageview child controls in the custom Uitableviewcell,cell, which need to be double-clicked for the picture to be displayed globally.
Two error codes
- (uitableviewcell *) TableView: (uitableview *) Tableview cellforrowatindexpath: (NSIndexPath *) indexpath{ bzeffectimgviewcell *cell = [bzeffectimgviewcell cellwithtableview:tableview]; uitapgesturerecognizer *doublerecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@ Selector (handlepinchgesturefrom:) ]; doublerecognizer.numberoftapsrequired = 2; /* * for BZEffectImgViewCell subspace beforeimageview, but event monitoring is unsuccessful */ [cell.beforeImageView addGestureRecognizer:doubleRecognizer]; return cell; }
Three correct codes
- (uitableviewcell *) TableView: (uitableview *) Tableview cellforrowatindexpath: (NSIndexPath *) indexpath{ bzeffectimgviewcell *cell = [bzeffectimgviewcell cellwithtableview:tableview]; uitapgesturerecognizer *doublerecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@ Selector (handlepinchgesturefrom:) ]; doublerecognizer.numberoftapsrequired = 2; //settings cell.afterimageview.userinteractionenabled = yes; cell.afterimageview.userinteractionenabled = yes; [cell.beforeimageview addgesturerecognizer:doublerecognizer]; return cell; }
IOS Custom UITableViewCell child controls cannot accept events