如何在android上將谷歌地圖圖層作為片段佈局移動 (how to move google map layers as fragment layout on android)


問題描述

如何在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 user2125791Karan_Rana)

參考文件

  1. how to move google map layers as fragment layout on android (CC BY‑SA 3.0/4.0)

#draw #Android #google-maps






相關問題

使用Java繪製維恩圖 (Draw Venn diagram using Java)

android中的ontouch:獲取X和Y坐標並在該點上繪製圓 (ontouch in android: getting X and Y coordinates and drawing circle on that point)

如何在android上將谷歌地圖圖層作為片段佈局移動 (how to move google map layers as fragment layout on android)

onTouch() 無法繪製畫布 (onTouch() can't draw canvas)

佈局僅在屏幕關閉或離開應用程序並返回後顯示兒童 (Layout only shows children after screen turn off or leaving the app and coming back)

將形狀對象的 ArrayList 繪製到框架 (Paint ArrayList of Shape Objects to Frame)

多線程圖形 (multithreading Graphics)

一次性繪製所有 DrawableGameComponents (Drawing all DrawableGameComponents in a single batch)

html5畫布繪製帶有額外數據的圓形變量 (html5 canvas draw circle variables with extra data)

iphone初學者問題:畫一個矩形。我究竟做錯了什麼? (Beginner iphone question: drawing a rectangle. What am I doing wrong?)

連接 4 Android Studio 繪製空格 (Connect 4 Android Studio Draw empty spaces)

矩形不動 (Rectangle is not moving)







留言討論