在 TextView 中打开 EditText 的键盘

发布于 2024-12-01 06:42:19 字数 194 浏览 3 评论 0原文

我有一个 Spinner(在对话框内),其中包含 EditText 作为其元素之一。 问题是当我在 EditText 内部单击时没有显示键盘。 我尝试了各种方法,例如每当发生 OnClick 或 OnItemSelected 事件时使用 InputMethodManager 手动打开软键盘,但这些方法都不适合我。

有什么建议吗?

提前致谢。

I have a Spinner(inside a dialog) that contains an EditText as one of its element.
The problem is that no keyboard is shown when I click inside the EditText.
I tried various methods like manually opening the softkeyboard with the InputMethodManager whenever there is an OnClick or OnItemSelected event occurs but none of these worked for me.

Any tips?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱本泡沫多脆弱 2024-12-08 06:42:19

试试这个,

InputMethodManager m = (InputMethodManager) 
  if(m != null){
      m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
   } 

Try this,

InputMethodManager m = (InputMethodManager) 
  if(m != null){
      m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
   } 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文