gpt4 book ai didi

java - 如何删除DatePickerDialog背景

转载 作者:行者123 更新时间:2023-12-01 09:19:50 24 4
gpt4 key购买 nike

我想删除 DatePickerDialog 中多余的背景

enter image description here

这是我的代码

DatePickerDialog dpd = new DatePickerDialog(RegisterActivity.this, android.R.style.Theme_Holo_Dialog, date,
myCalendar.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH));

最佳答案

您可以像这样覆盖对话框主题:

<style name="TransparentDatePickerDialogTheme" parent="AlertDialog.AppCompat">
<item name="android:windowBackground">@android:color/transparent</item>
</style>

然后像这样应用主题

DatePickerDialog dpd = new DatePickerDialog(RegisterActivity.this, R.style.TransparentDatePickerDialogTheme, date,
myCalendar.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH));

关于java - 如何删除DatePickerDialog背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40237553/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com