当触摸特定的EditText时,我不希望软键盘出现。 但我仍然希望能够根据用户请求显示软键盘(例如,按下按钮时)并允许用户编辑文本。 我知道如何显示/隐藏软键盘,我只是不知道如何防止它出现在触摸上。 有什么建议怎么办?
一般的想法是,用户将主要处理文本中的选择/位置,并且仅偶尔输入字符。 在选择或导航文本时,我不希望软键盘减少可见的文本量。
I don't want the soft keyboard to appear when a particular EditText is touched. But I still want to be able to show the soft keyboard upon user request (say, when a button is pressed) and allow the user to edit the text. I know how to show/hide the soft keyboard, I only don't know how to prevent it from appearing on touch. Any suggestion how to do it?
The general idea is that the user will be mostly working with selection/position within the text, and only occasionaly entering characters. I don't want the visible amount of text to be reduced by the soft keyboard when selecting or navigating the text.
最满意答案
简单地用
txtEdit.setShowSoftInputOnFocus(false);当你想启用它时,反转上面的过程
simply use
txtEdit.setShowSoftInputOnFocus(false);and when you want to enable that , reverse above process
更多推荐
发布评论