BottomSheetDialogFragment弹出背景色透明,展示完整

@Override

public void onStart() {

super.onStart();

    Window window = getDialog().getWindow();

    WindowManager.LayoutParams windowParams = window.getAttributes();

    windowParams.dimAmount =0.0f;

    window.setAttributes(windowParams);

    BottomSheetDialog dialog = (BottomSheetDialog) getDialog();

    FrameLayout bottomSheet = dialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet);

    if (bottomSheet !=null) {

BottomSheetBehavior  behavior = BottomSheetBehavior.from(bottomSheet);

        // 初始为展开状态

        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);

    }

}

你可能感兴趣的:(BottomSheetDialogFragment弹出背景色透明,展示完整)