以下是布局文件
<?xml version="1.0" encoding="utf-8"?>
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="10dp"
android:background="@drawable/search_bg">
<Button
android:id="@+id/search_dish_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="查找"
android:background="@drawable/search_btn_selecter" />
<EditText
android:id="@+id/search_dish_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/search_dish_button"
android:hint="搜外卖"
android:singleLine="true" />
<Button
android:id="@+id/search_dish_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:background="@drawable/search_clear_btn"
android:layout_alignRight="@id/search_dish_edit"
android:layout_centerVertical="true" />
</RelativeLayout>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>