我想創建一個簡單的界面,頂部的MapView
和底部的Button
刷新說MapView
。這兩個元素應該fill_parent
在寬度,但我希望他們不重疊在高度。我的問題是我的mapview似乎與我的Button
重疊並隱藏它。這是我的layout.xml
:問題與佈局Android
<?xml version="1.0" encoding="utf-8"?>
<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/mapview"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="my_api_key" />
<Button
android:id="@+id/close"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:text="@string/title_close" />
</LinearLayout>
在此先感謝。
而使用'layout_height = 「WRAP_CONTENT」'上的按鈕,不要忘記 – 2011-04-11 10:41:32
是的,謝謝。在上次編輯中已經有所改進。 – Olegas 2011-04-11 10:42:40
很好,有幫助。你有沒有機會參考教程?除了developer.android.com中的一個 – Syllkons 2011-04-11 10:58:15