AndroidUtilCode 软键盘收起后又弹出了

oewdyzsn  于 9个月前  发布在  Android
关注(0)|答案(1)|浏览(112)

在业务中使用 showSoftInput(@nonnull final View view),切换键盘代码

  1. if (!isShowEmojiPanel) {
  2. KeyboardUtils.hideSoftInput(etMsgSend)
  3. showEmojiFragment()
  4. } else {
  5. KeyboardUtils.showSoftInput(etMsgSend)
  6. hideEmojiFragment()
  7. }
  8. isShowEmojiPanel = !isShowEmojiPanel

有一条路径必现软键盘收起后又弹出,查找是 imm.toggleSoftInput 导致,删除 imm.toggleSoftInput 这个代码后没问题了

rqcrx0a6

rqcrx0a61#

同上,如果bottomsheetdialog里有个edittext,弹起键盘后再关闭弹框,键盘又会弹起来。
dismiss里已经做了处理,依然不行

相关问题