1首先在style文件中:
<style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item>
</style>
<style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal">
<item name="behavior_peekHeight">500dp</item>
</style>
2:然后再创建的地方引用这个style创建BottomSheetDialog
public PrinterMenuDialog(@NonNull Context context) {
super(context,R.style.BottomSheetDialog);
initView();
}
这样弹出高度解决了