BottomSheetDialog无法设置圆角的解决问题

1、设置background为透明

	<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="android:background">@android:color/transparent</item>
    </style>

2、应用样式
在这里插入图片描述
dialog_take_pic.xml最外层布局(LinearLayout)加上圆角样式代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners
        android:topLeftRadius="5dp"
        android:topRightRadius="5dp" />
    <solid android:color="@color/white" />
</shape>

猜你喜欢

转载自blog.csdn.net/qq_35091074/article/details/131769240
今日推荐