BottomSheetDialog高度不足够显示全部内容的解决办法

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();
}

这样弹出高度解决了

猜你喜欢

转载自blog.csdn.net/xzytl60937234/article/details/82960142