1

我想从下图所示的软键盘中删除搜索按钮,该怎么做?在此处输入图像描述

4

2 回答 2

2

搜索了很多之后android:imeOptions="actionNone"。将此添加到您的 SearchView xml 代码中。

<androidx.appcompat.widget.SearchView
                        android:id="@+id/searchView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:focusable="false"
                        android:imeOptions="actionNone"
                        android:queryBackground="@android:color/transparent"
                        app:iconifiedByDefault="false"
                        app:queryHint="Search Name" />

它替换为下一行图标,您应该先尝试一下。谢谢,我后者。

于 2020-02-28T08:19:08.787 回答
0

除了 Bill Gary 建议的内容之外,您还可以调用setImeOptions()对象SearchView

于 2013-12-06T21:29:25.683 回答