3

有以下简单的布局:

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

    <com.google.android.maps.MapView
        android:id="@+id/activityMainPoints"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:apiKey="0JsSnv022MOCCXMAJfsQTVtfCiH37VG5XykFLmQ"
        android:clickable="true" />

</RelativeLayout>

如您所见,MapView 必须填充完整的父容器 RelativeLayout,但事实并非如此!我该如何解决?

4

2 回答 2

0
android:layout_width="fill_parent"
android:layout_height="fill_parent"
于 2013-04-29T11:02:01.023 回答
0

尝试这个:

 <?xml version="1.0" encoding="utf-8"?>
    <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/activityMainPoints"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="0JsSnv022MOCCXMAJfsQTVtfCiH37VG5XykFLmQ"
        android:clickable="true"
        />
于 2013-04-29T11:18:58.643 回答