android - 带搜索图标的键盘

标签 android search keyboard icons imeoptions

我的应用程序中有一个 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/

相关文章:

android - 为不同屏幕密度转换布局 dpi 的工具

java - 如何从 Activity 中调用类(class)

java - 无法解析第三方库

bash - Linux : Search for coincidences in four different files

iphone - 在正确的时间显示键盘 iOS7

ios - 在 iOS 8 键盘中选择时检测笑脸和地球仪

linux - 在 Debian 中映射我的自定义键

android - 如何在 android 中使用 RTSP 链接直播视频?

c - 算法(!=线性搜索)在整数数组中查找第一个小于 X 的数字

php - 使用 like 或 contains 进行 sql 搜索