📜  android BottomSheetDialogFragment 未在横向上完全打开 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.303000             🧑  作者: Mango

代码示例1
class MyBottomSheetFragment : BottomSheetDialogFragment() {
    //....
    override fun onStart() {
        super.onStart()
        //this forces the sheet to appear at max height even on landscape
        val behavior = BottomSheetBehavior.from(requireView().parent as View)
        behavior.state = BottomSheetBehavior.STATE_EXPANDED
    }
}