我的应用程序中有一个 SearchActivty
,其中有一个 EditText
和一个 Button
来搜索项目。我希望此 EditText
的搜索图标显示在键盘中。
现在,我的 EditText
布局中有 imeOption = "actionSearch"
,该布局现在在键盘中将“search”作为文本提供。我希望应该有一个图标而不是文本。是否可以在键盘中的文本位置设置搜索图标。如果是,请帮忙。
布局中我的 EditText
是:
<EditText
android:id="@+id/txtUser"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="type name here"
android:inputType="text"
android:singleLine="true"
android:imeOptions="actionSearch"/>
最佳答案
不,这是不可能的。键盘本身决定什么应该显示在哪里。有些键盘会为各种 imeOptions 实现图像,有些则不会。但没有办法强制它。
关于android - 带搜索图标的键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24463745/