개발/Android

[안드로이드] Bottom Sheet Dialog Fragment 생성시 fullScreen 적용

라보떼 2021. 12. 17. 13:33

 

 

 

 

Bottom Sheet Dialog  를 Show 했을때 dialog의  height 가 특정 값 이상이 되면 Dialog가 아래로 내려간 상태로 생성됩니다.

생성시 전체 height에 맞게 다 보이도록 생성되는 방법입니다.

 

 


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

      return dialog
  }

onCreateDialog를 override하여 위와 같이 적용