Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/224.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android中的搜索建议_Android_Listview_Search - Fatal编程技术网

Android中的搜索建议

Android中的搜索建议,android,listview,search,Android,Listview,Search,我已经使用edittext和listview在android中完成了搜索建议 我需要的是在我的活动中,在编辑文本之后有很多按钮,当我在编辑文本中键入字母时,它将在列表视图中显示相应的搜索,但按钮将出现在该列表视图之后 我的xml文件如下所示 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:l

我已经使用edittext和listview在android中完成了搜索建议

我需要的是在我的活动中,在编辑文本之后有很多按钮,当我在编辑文本中键入字母时,它将在列表视图中显示相应的搜索,但按钮将出现在该列表视图之后

我的xml文件如下所示

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
 <!-- Editext for Search -->
<EditText android:id="@+id/inputSearch"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="Search products.."
    android:inputType="textVisiblePassword"/>

<!-- List View -->
<ListView
    android:id="@+id/list_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="after Edit Text"/>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Second Button"/>
</LinearLayout>

我得到的输出是


我需要的是我的建议列表,在可搜索的编辑文本之后,不应干扰背景中的任何按钮,如有任何帮助,将不胜感激。

将布局更改为以下内容::在listView之前移动按钮

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
 <!-- Editext for Search -->
<EditText android:id="@+id/inputSearch"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="Search products.."
    android:inputType="textVisiblePassword"/>

<Button android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="after Edit Text"/>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Second Button"/>

<!-- List View -->
<ListView
    android:id="@+id/list_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />


</LinearLayout>

我想你要找的是一个
自动完成文本视图
。。