0
我需要將其他圖像按鈕「我的當前位置」放置到MapView的右上角。任何想法如何做到這一點?Android MapView - 如何將附加控件附加到所需位置的MapView
提出通用問題:
1)根據MapView文檔,可以將附加視圖對象附加到MapView。這個怎麼做?
2)如何將這些附加控件放置在MapView的特定位置?
我需要將其他圖像按鈕「我的當前位置」放置到MapView的右上角。任何想法如何做到這一點?Android MapView - 如何將附加控件附加到所需位置的MapView
提出通用問題:
1)根據MapView文檔,可以將附加視圖對象附加到MapView。這個怎麼做?
2)如何將這些附加控件放置在MapView的特定位置?
下面的示例將在MapView的一個按鈕,只需複製粘貼,然後移動按鈕,你喜歡它:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_main"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0y6Hyjz6Kxo-NOV_9KHYF7-ECYeGt99xeyVU3IQ"/>
<Button
android:id="@+id/select_3"
android:layout_centerHorizontal="true"
android:layout_marginTop="13dp"
android:text="Center on Pickup Location"
style="@style/BasicButton"
android:layout_height = "40dp"
android:layout_width = "280dp"
android:onClick="selfSelectCenterLocation">
</Button>
</RelativeLayout>