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感謝我建議在飛行中糾正這種錯誤,無論如何,糾正以備將來使用。 –