[英]How to remove the shadow created by bottom sheet dialog fragment in android?
我创建了一个模态底部工作表对话框片段,但它在展开时会用阴影或透明黑色覆盖整个屏幕。
如何从底页片段中删除该阴影?
试试我下面的代码:
1.在style.xml中创建一个底表样式
<style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="android:backgroundDimAmount">0</item>
</style>
2. 将您的样式添加到您的 BottomSheetDialogFragment 上的 onCreate function
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.BottomSheetDialog);
}
希望有所帮助:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.