重写show方法
@Override
public void show() {
super.show();
//设置高度
FrameLayout bottomSheet = (FrameLayout) findViewById(android.support.design.R.id.design_bottom_sheet);
ViewGroup.LayoutParams originLayoutParams = bottomSheet.getLayoutParams();
originLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
bottomSheet.setLayoutParams(originLayoutParams);
BottomSheetBehavior mDialogBehavior = BottomSheetBehavior.from(bottomSheet);
mDialogBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
网友评论