<
LinearLayout
android
:layout_width=
"match_parent"
android
:layout_height=
"wrap_content"
>
<
EditText
android
:layout_width=
"wrap_content"
android
:layout_weight=
"1"
android
:layout_height=
"wrap_content"
/>
<
Button
android
:layout_width=
"wrap_content"
android
:layout_height=
"wrap_content"
/>
</LinearLayout>
让Button自适应大小,EditText占满剩余部分(权重小的先占有)