Keyboard hides BottomSheetDialogFragment

后端 未结 6 1410
走了就别回头了
走了就别回头了 2020-12-04 13:22

There are more fields below the keyboard. This happened when i updated the support library. I know it\'s Kotlin but it looks almost the same as java. How do I fix this issue

6条回答
  •  独厮守ぢ
    2020-12-04 14:14

    I found the solution for 27 api. So the reason why keyboard hides view even with SOFT_INPUT_ADJUST_RESIZE is that the windowIsFloating is set for Dialogs.

    The most convenient way that I found to change this is by creating style:

    
    

    And set this in onCreate method of your BottomSheetDialogFragment:

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setStyle(DialogFragment.STYLE_NORMAL, R.style.DialogStyle)
    }
    

    This is how it looks on my device:

提交回复
热议问题