android按钮在同一行,Android EditText和Button在同一行

我需要在搜索按钮旁边有一个Edittext。 EditText应该填充尽可能多的宽度,按钮应该在右边,只是大到足以有它的文本。 现在看起来像这样: [EDIT

我需要在搜索按钮旁边有一个Edittext。 EditText应该填充尽可能多的宽度,按钮应该在右边,只是大到足以有它的文本。

现在看起来像这样:

[EDIT TEXT][Search]

但应该看起来像这样:

[.......EDIT TEXT.......][Search]

这里是XML:

android:layout_alignParentLeft="true"

android:layout_centerVertical="true"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:hint="type to filter"

android:inputType="text"

android:maxLines="1" />

android:layout_toRightOf="@id/search_box"

android:text="Search"

android:layout_width="wrap_content"

android:layout_height="wrap_content"/>