当我们向下拖拽时,BottomSheetBehavior的状态变为了STATE_HIDDEN,而BottomSheetDialog在内部用BottomSheetBehavior对状态做了处理,再次show之后,系统未恢复bottomSheetDialogBehavior的状态,还是隐藏
final BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from((View) bottomView.getParent()); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); if (mUiData.getBottomSheetDialog() == null) { mUiData.getBottomSheetDialog().setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } }); } mUiData.getBottomSheetDialog().show();
转:https://blog.youkuaiyun.com/u010198148/article/details/53670629