其他分享
首页 > 其他分享> > Android 键盘弹出与隐藏

Android 键盘弹出与隐藏

作者:互联网

 //弹出软键盘
        InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);


 //隐藏软键盘
                InputMethodManager inputMgr = (InputMethodManager) context
                        .getSystemService(Context.INPUT_METHOD_SERVICE);
                inputMgr.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
一点一滴的积累 发布了184 篇原创文章 · 获赞 70 · 访问量 37万+ 他的留言板 关注

标签:HIDE,SERVICE,InputMethodManager,toggleSoftInput,键盘,弹出,Android,METHOD,inputMgr
来源: https://blog.csdn.net/qq_31939617/article/details/103929691