我試圖首次在Android中顯示地圖。 現在I want to display 3 buttons on the map, and when I clicked on a particular button, that button's click event should be raised.
地圖應該全屏顯示,按鈕位於下方。Android - 帶3個按鈕的地圖
我不知道我是怎麼做到的?當我們想要使用MapView顯示地圖時,我們必須擴展MapActivity類。所以請建議一些想法,例子或參考網站。
編輯:
我曾嘗試使用下面的佈局顯示的地圖:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:id="@+id/mapView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:enabled="true"
android:clickable="true"
android:apiKey="my generated api key"
/>
<Button
android:text="Button"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
'RelativeLayout'就是你需要的。雖然......首先讓地圖單獨出現。看來你還沒有完成那部分。一旦你有地圖工作,做按鈕的東西很容易。 – Cristian 2010-08-23 05:10:53
@Cristian結帳我給了我用來顯示地圖的佈局編碼..現在我該怎麼辦? thanx的幫助 – 2010-08-23 05:22:05