BottomSheetDialog基础设置

BottomSheetDialog dialog = new BottomSheetDialog(_mActivity);
dialog.setContentView(view);
//设置BottomSheetDialog的默认初始高度
BottomSheetBehavior sheetBehavior = BottomSheetBehavior.from((View) view.getParent());
sheetBehavior.setPeekHeight(Utils.getDisplayHeight(_mActivity) - Utils.dip2px(_mActivity, 90));
//设置BottomSheetDialog的背景为透明
dialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(android.R.color.transparent);
//显示
dialog.show();

猜你喜欢

转载自blog.csdn.net/ChrisSen/article/details/86086146