在 MapActivity 中调整地图大小

Resize map in a MapActivity

我想启动一个MapActivity,但是地图只占了部分屏幕,所以要把信息放在对方身上。我该怎么做?

使用片段来实现你的目标。例如:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="100dp" />
       <!-- here remaining layout-->


</RelativeLayout> 

片段用于 google 地图,宽度定义为 match_parent,高度定义为 100dp。您可以在此片段下方定义布局或根据需要自定义布局。