Android 解决Dialog导致软键盘无法隐藏的问题
发布日期:2021-06-29 11:46:12 浏览次数:3 分类:技术文章

本文共 343 字,大约阅读时间需要 1 分钟。

解决办法:

hideSoftInputFromWindow(view.getWindowToken(), 0);这个方法中的第一个参数传dialog的view

例如:

Dialog dialog = new Dialog(getContext(), R.style.ActionSheetDialogStyle);InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(dialog.getWindow().getDecorView().getWindowToken(), 0);

 

转载地址:https://blog.csdn.net/zz51233273/article/details/106072019 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:初学Flutter--Assets资源文件
下一篇:JAVA的引用类型

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年04月14日 06时09分03秒