對不起,如果我問這樣一個基本的問題。我已經嘗試谷歌整個上午,並閱讀在developer.android.com的文件,但我找不到解決方案。Android GUI - 如何強制按鈕到下一行?
總之,我想提出,看起來像這樣的接口:
這是我到目前爲止有:
現在,我試圖將2個按鈕帶到下一行,但我仍然沒有運氣。如果我將android:orientation =「horizontal」更改爲「vertical」,則所有內容均垂直對齊。我試圖在Button標籤內放入android:orientation =「vertical」這一行,但這似乎不起作用。
我還能試試嗎?有人會給我幾個指針嗎? (我在Android開發和所有這些XML的東西新)。
下面是我的XML代碼:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<EditText android:id="@+id/txt_Input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/txt_Input"
android:layout_weight="4"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_Send"
android:layout_weight="1"
android:onClick="sendMessage"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_Send"
android:layout_weight="1"
android:onClick="sendMessage"
/>
</LinearLayout>
謝謝您的詳細解答。這非常有幫助! – TATN
小修正,這是對RightOf,而不是Righof –