【问题标题】:Swift - GoogleMaps SDK get single or double finger tap gesturesSwift - GoogleMaps SDK 获得单指或双指点击手势
【发布时间】:2019-12-14 07:00:22
【问题描述】:

我在我的项目中使用 Google Maps SDK。我想检查并检测何时点击使用单指或双指的谷歌地图? 我的要求是,禁用单指使用并启用双指使用。我希望所有手势都在双指而不是单指上工作。

【问题讨论】:

    标签: ios objective-c iphone swift4


    【解决方案1】:

    首先,禁用 GMSMapView 实例上的所有手势。文档说:

    You can disable the default gestures on the map by setting properties of the GMSUISettings class, which is available as a property of the GMSMapView

    来源:https://developers.google.com/maps/documentation/ios-sdk/controls

    那么你也许可以添加一些UITapGestureRecognizer:

    来源:https://developer.apple.com/documentation/uikit/uitapgesturerecognizer

    别忘了将numberOfTouchesRequired 设置为2

    来源:https://developer.apple.com/documentation/uikit/uitapgesturerecognizer/1623580-numberoftouchesrequired

    【讨论】:

    • 让我检查一下:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多