Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Linearlayout 中有两个 EditText 视图和一个按钮。在edittext中写入完成后,我想隐藏Android虚拟键盘,我该怎么做?
您可以像这样使用 InputMethodManager 类:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);