我试图首次在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