Reputation: 1019
I am using datepickerdialog in dialogfragement and the spinners are transparent as showing in this image How i can fix this?
Thanks
Upvotes: 2
Views: 2066
Reputation: 49
DatePickerDialog dialog = new DatePickerDialog(context, R.style.DialogTheme,
new MyDateSetListener(), selectedYear, selectedMonth, selectedDate);
dialog.getWindow().setBackgroundDrawable(getDrawable(R.color.white));
I faced same problem and this did the job done
Upvotes: 0
Reputation: 758
Define a custom dialog theme by setting the back ground color in your styles.xml as below.
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/white</item>
</style>
And apply this theme to the date picker dialog while creating as
DatePickerDialog dialog = new DatePickerDialog(context, R.style.DialogTheme,
new MyDateSetListener(), selectedYear, selectedMonth, selectedDate);
Hope this helps.
Upvotes: 2