問題描述
如何在android上將谷歌地圖圖層作為片段佈局移動 (how to move google map layers as fragment layout on android)
Good day, We are developing an android app that needs to include google map. For the layout we followed the instruction on the following link. i.e, the menu for our app, will slide(not overlapping but rather it will "push" the map).
Sidebar like facebook
The map moves, but it seems that some layers remain e.g. zoom in/zoom out buttons. and our menu does not display correctly.
Taking screenshot of the supposed error, on the other hand provide the desired display. but to describe the error, the area below the map is a black area with some green spots taking the old position of zoomin zoomout and the our toggle button.
‑‑‑‑‑
參考解法
方法 1:
I was also facing this strange issue.Fixed it as follows by applying a transparent View over the mapview fragment seems to resolve the issue. Its a kind of hack.See if it works for you
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="300dp" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<View
android:id="@+id/imageView123"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" />
</RelativeLayout>
(by user2125791、Karan_Rana)