永发信息网

安卓想不通怎么用setImeActionLabel-java,安卓android,edittext

答案:2  悬赏:40  手机版
解决时间 2021-03-07 07:56
  • 提问者网友:鐵馬踏冰河
  • 2021-03-06 09:08
安卓想不通怎么用setImeActionLabel-java,安卓android,edittext
最佳答案
  • 五星知识达人网友:酒醒三更
  • 2021-03-06 09:19
The imeActionLabel sets the label for the button that appears on the top right on full screen IME mode (i.e., when your phone is in landscape). If you want to change the button to the bottom right of the keyboard, you can pass certain flags to imeOptions.
As far as I know, for that button you're limited to a certain set of actions (see here for a full list of supported flags), but since you seem to want a search button, all you have to do is to slightly adjust your first line and use IME_ACTION_SEARCH:
mSearchInput.setImeOptions(EditorInfo.IME_ACTION_SEARCH);

Mind you, the exact appearance of that button will depend on the input method. The default Android keyboard shows a magnifier for the search flag, while the Touch Input (HTC's keyboard) seems completely unaware of that flag, still showing a return button.
的imeActionLabel设置标签的按钮,出现在右上角全屏输入法模式(即。当你的手机在景观)。如果你想改变这个按钮右下角的键盘,你可以通过特定的旗帜imeOptions .
据我所知,这个按钮你限制在一个特��的行动(见在这里完全支持的标记列表),但既然你似乎想要一个搜索按钮,你所要做的就是稍微调整你的第一行和使用IME_ACTION_SEARCH :
mSearchInput.setImeOptions(EditorInfo.IME_ACTION_SEARCH);

请注意,这个按钮的具体外观将取决于输入方法。搜索的默认安卓键盘显示了一个放大镜标志,而触摸输入(HTC的键盘)似乎完全不知道国旗,仍然显示一个返回按钮。
全部回答
  • 1楼网友:山河有幸埋战骨
  • 2021-03-06 09:49
没有导入android.widget包, 按ctrl+shift+o 可以自动导入项目需要的所有包, 或者你截图的右下方有个 ”导入edittext“ , 点它就可以了。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯