Disable double tap zoom in MKMapView (iOS 6)

后端 未结 5 937
清歌不尽
清歌不尽 2021-01-12 17:57

in ios 5 i was able to disable the double tap zoom by just overriding it with a new double tap gesture. But it seems that the double tap gesture is no longer in the gesturer

5条回答
  •  没有蜡笔的小新
    2021-01-12 18:15

    I'd look through the gesture recognizers of MKMapView's subviews. It's probably still there somewhere.

    Of course, messing around with another view's GRs is slightly dubious and will likely break the next time Apple changes something about MKMapView...

    EDIT: For the benefit of anyone else reading this, please check that it's a UITapGestureRecognizer and that numberOfTapsRequired == 2 and numberOfTouchesRequired == 1.

    Also, instead of disabling double-taps on the map entirely, consider adding a double-tap GR on the annotation and then do [mapDoubleTapGR requireGestureRecognizerToFail:annotationDoubleTapGR]. Again, hacky — don't blame me if it breaks on the next OS update!

提交回复
热议问题