Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我可以在GooglMap API2中禁用多点触摸缩放吗_Android_Google Maps_Android Maps V2 - Fatal编程技术网

Android 我可以在GooglMap API2中禁用多点触摸缩放吗

Android 我可以在GooglMap API2中禁用多点触摸缩放吗,android,google-maps,android-maps-v2,Android,Google Maps,Android Maps V2,在谷歌地图API 2中是否可以禁用/启用多点触摸缩放?我喜欢在必要时通过编程禁用或启用它。 多谢了多点触摸缩放通常在系统级别处理。你可以有一个开关来打开/关闭缩放,但不是多点触摸(据我所知) 通常,您应该能够通过以下方式切换缩放: disableScrollWheelZoom(); 以及: 您可以对用户代理(移动)执行检查,并在默认情况下禁用这些代理,然后提供启用选项。要禁用多点缩放,您可以在XML文件中使用此选项: map:uiZoomGestures="true" 您必须添加映射命名空间

在谷歌地图API 2中是否可以禁用/启用多点触摸缩放?我喜欢在必要时通过编程禁用或启用它。
多谢了

多点触摸缩放通常在系统级别处理。你可以有一个开关来打开/关闭缩放,但不是多点触摸(据我所知)

通常,您应该能够通过以下方式切换缩放:

disableScrollWheelZoom();
以及:


您可以对用户代理(移动)执行检查,并在默认情况下禁用这些代理,然后提供启用选项。

要禁用多点缩放,您可以在
XML
文件中使用此选项:

map:uiZoomGestures="true"
您必须添加映射命名空间才能像这样使用它:

 xmlns:map="http://schemas.android.com/apk/res-auto"
在片段xml代码中:

 <fragment
     xmlns:map="http://schemas.android.com/apk/res-auto"
     android:id="@+id/map"
     android:name="com.google.android.gms.maps.SupportMapFragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     map:uiZoomGestures="true"

我在android中使用API2,但我的谷歌地图没有这些API。对不起。我误解了。我的答案是纯谷歌地图v2版。我对Android地图API不是非常熟悉,但这个答案可能会有帮助。。。
 <fragment
     xmlns:map="http://schemas.android.com/apk/res-auto"
     android:id="@+id/map"
     android:name="com.google.android.gms.maps.SupportMapFragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     map:uiZoomGestures="true"
map.getUiSettings().setZoomGesturesEnabled(false);