美文网首页
BottomSheetDialogFragment弹出背景色透明

BottomSheetDialogFragment弹出背景色透明

作者: 木叶纷飞 | 来源:发表于2019-02-25 11:49 被阅读0次

    @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弹出背景色透明

          本文链接:https://www.haomeiwen.com/subject/ygbwyqtx.html