BottomSheetDialog 弹出底部内容显示不全 需要滑动问题以及显示后背景圆角不显示问题解决使用以下style
dialog需要的高度
<item name="behavior_peekHeight">600dp</item>
高度显示全后发现背景圆角无法显示,设置圆角背景不生效 原因:由于它上面蒙了一层布局 design_bottom_sheet是系统的布局,直接找到它,然后给它设全透明就好了
第一种设置透明方式
getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet)
.setBackgroundColor(
getContext().getResources().getColor(android.R.color.transparent));
第二种设置透明方式直接在style中加入
<item name="android:background">@android:color/transparent</item>
完整的style使用
super(context,R.style.BottomSheetDialog);
<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">600dp</item>
<item name="android:background">@android:color/transparent</item>
</style>