iOS TapgeStureRecognizer double-click NumberoftapSRequired = 1

I have a MPMoviePlayerViewController, I put a UIView on it to recognize the click, and then I can display the control panel of the video, double-click to zoom in/out the video playback, so I use gestures The recognizer sets numberOfTapsRequired = 1, but when I double-click, the video will not zoom, but the control panel will display and then disappear, as if there are two clicks.

Is there anyway to solve it? ?

Thank you!

Yes. [UIGestureRecognizer requireGestureRecognierToFail:] is for this purpose . Set your click gesture recognizer to require the double tap gesture recognizer to fail. If it does not fail, then zoom occurs. If it does fail (i.e. you only clicked once instead of twice), then your control panel It will be displayed.

I have a MPMoviePlayerViewController, I put a UIView on it to recognize the click, and then I can display the control panel of the video, double-click to zoom in/out the video playback , So I set numberOfTapsRequired = 1 for the gesture recognizer, but when I double-click, the video will not zoom, but the control panel will display and then disappear, as if there are two clicks.

No matter How to solve it?

Thank you!

Yes. [UIGestureRecognizer requireGestureRecognierToFail:] is for this purpose. Set your click gesture recognizer as required The double-tap gesture recognizer fails. If it does not fail, then zooming occurs. If it does fail (i.e. you only clicked once instead of twice), then your control panel will show up.

Leave a Comment

Your email address will not be published.