dialog.setContentView(view);
dialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet)
.setBackgroundColor(context.getResources().getColor(R.color.transparent));
第二句,設(shè)置它的背景為透明色,必須在setcontentView后面否則會報錯。
解決bottomSheetDialogFragment設(shè)置背景樣式失敗的問題。
去掉BottomSheetDialogFragment自帶的白色背景。