當前在我的代碼中,按鈕顯示在另一個之下,地圖顯示在其下方。我想讓這兩個按鈕顯示在地圖的同一行上。如何顯示兩個水平按鈕,並在地圖下方
我的代碼是:
<?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">
<Button
android:id="@+id/btnProgram"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Program" />
<Button
android:id="@+id/btnAfisareStatii"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Afisare Statii" />
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0ws8opHdf-pIbZUa916nju81kSSlPRK4Wbg_0vg"
/>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<WebView
android:id="@+id/webview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
它工作正常,謝謝你這麼多。 – Andreea 2012-04-25 08:58:35
你能告訴我如何讓按鈕來填補每行的一半? – Andreea 2012-04-25 10:46:42
嗯..爲此,你真的需要用'android:weightSum =「1」'將水平'Linearlayout'中的兩個按鈕包裝起來,併爲每個按鈕設置'android:layout_weight =「0.5」''。 – Adinia 2012-04-25 10:52:08