Ich möchte, dass der EditText den gesamten verfügbaren Platz auf der rechten Seite füllt, bis der Button rechts daneben steht. Ich verwende RelativeLayout, um eine solche Ansicht zu erstellen. Aber im Ergebnis habe ich meine Schaltfläche nicht sichtbar, den einzigen EditText. Bitte beachten Sie, wie Sie beide sichtbar machen können.Platzieren von zwei Ansichten in einer Zeile mit RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<EditText
android:id="@+id/edit_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Task description">
</EditText>
<Button
android:id="@+id/ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK"
android:layout_toRightOf="@id/edit_text">
</Button>
</RelativeLayout>
</LinearLayout>
Es funktioniert, vielen Dank. – Eugene