मैं का उपयोग कर UIImages
की गैलरी प्रदर्शित करने के लिए एक एप्लिकेशन विकसित कर रहा हूं, मेरा प्रश्न है कि zoom
पर टैप करने के लिए कैसे करें और zoom
पर दो बार टैप करें, UIScrollView
के साथ संभालने पर यह कैसे काम करता है। असल में इस कोड को कह रहा है कि जब एक UITapGesture
self.view
विधि tapOnce या tapTwice में पंजीकृत हैself
में बुलाया जाएगा अपने ViewControllerआईओएस में ज़ूम आउट करने के लिए ज़ूम करने और दो बार टैप करने के लिए टैप करने के लिए कैसे टैप करें?
- (void)viewDidLoad
{
[super viewDidLoad];
// what object is going to handle the gesture when it gets recognised ?
// the argument for tap is the gesture that caused this message to be sent
UITapGestureRecognizer *tapOnce = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnce:)];
UITapGestureRecognizer *tapTwice = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwice:)];
// set number of taps required
tapOnce.numberOfTapsRequired = 1;
tapTwice.numberOfTapsRequired = 2;
// stops tapOnce from overriding tapTwice
[tapOnce requireGestureRecognizerToFail:tapTwice];
// now add the gesture recogniser to a view
// this will be the view that recognises the gesture
[self.view addGestureRecognizer:tapOnce];
[self.view addGestureRecognizer:tapTwice];
}
में - डॉक्स here -
आप अपने जवाब के लिए बहुत बहुत धन्यवाद, मैं इसे परीक्षण करने और वापस रिपोर्ट जल्द से जल्द किया है जाएगा। – Bruno
क्या यह संभव है वेबव्यू पहचान पक्ष के वेबव्यू – Codesen
में लिंक को स्पर्श करें [टैपऑन की आवश्यकता है GestureRecognizerToFail: tapTwice]; वही है जो मैं खोज रहा था। धन्यवाद! – Bastek