软键盘 Del 键在 Android 上不起作用
我正在为使用软键盘的应用程序使用编辑文本。
我正在使用文本观察器,正如有关如何检测软键盘按键事件的帖子中所建议的那样,但我无法删除在编辑文本中输入的数据。这意味着在文本观察器中不会调用 del 键。
我已将 ime 选项设置为“操作完成”,但它仍然不起作用,这是我为调用软键盘所做的操作:
((CustomEditText)v).setImeOptions(EditorInfo.IME_ACTION_DONE);
InputMethodManager imm = (InputMethodManager) BookModel.getInstance()
.get_mActivity()
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(v.getWindowToken(),
InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
I am using edit text for my application for which soft keyboard is used.
I'm using a text watcher, as suggested in the posts on how to detect soft keyboard key press events, but I'm unable to delete the data which I've entered in the edit text. This means that the del key is not called in the text watcher.
I have set the ime options to "action done", but it's still not working, here's what I've done to invoke the soft keyboard:
((CustomEditText)v).setImeOptions(EditorInfo.IME_ACTION_DONE);
InputMethodManager imm = (InputMethodManager) BookModel.getInstance()
.get_mActivity()
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(v.getWindowToken(),
InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论