BottomSheetDialogFragment doesn't show full height in landscape mode

前端 未结 5 747
感情败类
感情败类 2020-12-28 18:13

I am using BottomSheetDialogFragment in my activity, the dialog shows full height in portrait mode but doesn\'t when I switch to landscape mode.

5条回答
  •  醉话见心
    2020-12-28 18:41

    This worked for me and was the cleanest approach:

    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
        val dialog = BottomSheetDialog(requireContext(), theme)
        dialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
        return dialog
    }
    

提交回复
热议问题