मैं वर्तमान में एक कस्टम UITableViewCell जो एक UIImageView शामिल है और कोई भाग्य के साथ UIImageView पर एक UITapGestureRecognizer जोड़ने की कोशिश कर। यहां कोड का स्निपेट है।UITapGestureRecognizer UIImageView पर UITablevlewCell के भीतर नहीं बुलाया हो रही
//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");
}
मैं भी सेल और UIImageView के superview लेकिन फिर भी प्रयास विफल, किसी भी संकेत पर userInteractionEnabled निर्धारित किया है?
संपादित:
मैं भी cell.selectionStyle = UITableViewCellSelectionStyleNone द्वारा सेल के चयन को दूर किया है; क्या यह एक समस्या हो सकती है
सबसे पहले, आप छवि दृश्य के बजाय UIButton का उपयोग क्यों नहीं कर रहे हैं? दूसरा, क्या आपने वास्तविक छवि दृश्य के लिए उपयोगकर्ता इंटरैक्शन को सक्षम किया? – Rog
@Rog 'cus मैं UIImageView के UIViewContentModeScaleAspectFit फ़ंक्शन का उपयोग करना चाहता हूं, क्या UIButton की समान कार्यक्षमता है? – Herman
स्क्रॉलव्यू में यूआईसींट्रोल का उपयोग करते समय यह स्पर्श शुरू होने पर स्क्रॉलिंग को अवरुद्ध करता है ... – JakubKnejzlik