0
我一直在努力使MapView不可点击。我希望有人也遇到这个问题。谷歌地图打开后点击MapView v2
这里是我的代码:
<com.google.android.gms.maps.MapView
android:id="@+id/map_header"
android:layout_width="fill_parent"
android:layout_height="90dp"
android:clickable="false"
android:longClickable="false"
map:liteMode="true"
map:mapType="normal"
/>
另外:
mMap.getUiSettings().setAllGesturesEnabled(false);
mMap.getUiSettings().setMapToolbarEnabled(false);
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(userLocation)
.zoom(16)
.build();
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
mProgressBar.setVisibility(View.GONE);
这只有当我使用精简版模式发生。在正常模式下,它不可点击。
感谢提前:)
GoogleMap的没有一个setClickable方法:(编辑:固定它,你需要setClickable(假)上的onCreate的MapView,而不是在GoogleMap的在onMapReady – Ruben2112
@ Ruben2112感谢我建议在飞行中纠正这种错误,无论如何,纠正以备将来使用。 –