1

わかりましたので、何が入っていても線形レイアウトの 25% を常に占めるボタンが必要です。残りの 75% は TextView フィールドになります。これが私がこれまでに持っているものです:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" 
    android:weightSum="1">

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="0dp "
        android:layout_weight=".25"
        android:text="" />

    <EditText
        android:id="@+id/edit_message"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight=".75"
        android:hint="@string/edit_message" />
</LinearLayout>

ただし、0dp ではボタンがなくなり、wrap_content では常にテキストを選択して幅を設定します。幅を設定する方法として重みを使用するにはどうすればよいですか。

4

4 に答える 4