Set state of BottomSheetDialogFragment to expanded

前端 未结 14 834
有刺的猬
有刺的猬 2020-11-30 19:11

How do you set the state of a fragment extending BottomSheetDialogFragment to expanded using BottomSheetBehavior#setState(STATE_EXPANDED) using the

14条回答
  •  既然无缘
    2020-11-30 19:34

    Apply BottomsheetDialogFragment state in onResume will solve this issue

    @Override
    public void onResume() {
        super.onResume();
        if(mBehavior!=null)
           mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
    

    onShow(DialogInterface dialog) and postDelayed may cause animation glitch

提交回复
热议问题