我在構建一個包含兩個按鈕和一個MapView的佈局。這些按鈕應放置在MapView的上方和下方。我已經嘗試了幾種佈局組合(相對,線性,框架...),但MapView不支持layout_height = wrap_content,除非我使用像layout_height =「200dp」這樣的特定高度。MapView不支持layout_height = wrap_content
顯示tope按鈕,但最下面的按鈕不是。以下是我的測試XML文件。
有什麼建議嗎?
的android:layout_width = 「FILL_PARENT」 機器人:layout_height = 「FILL_PARENT」 >
<Button
android:id="@+id/btn1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button1"
android:background="#FF0000" />
<com.google.android.maps.MapView
android:id="@+id/map1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:apiKey="my map key (removed for example)"
/>
<Button
android:id="@+id/btn2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button2"
android:background="#00FF00" />
謝謝,Mapview仍然不能很好地與其他佈局玩,但是這樣做。 – RickR 2011-06-10 00:15:09