我想全屏显示自定义对话框。 但现在不是。 我不知道为什么。
这是我的代码
val dialog = Dialog(requireContext())
val view = LayoutInflater.from(activity).inflate(R.layout.custom, null)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setContentView(view)
dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
dialog.window?.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
dialog.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
val dialog = Dialog(requireContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen)