0

My DatePickerDialog doesn't work properly. For example selected day is of white color. Notice that Cancel and OK button are also of white color. How could I change it?

https://tinypic.pl/phfssq7zm5s8

Here is the code:

 fun openCalendar() {
    val c = Calendar.getInstance()
    val year = c.get(Calendar.YEAR)
    val month = c.get(Calendar.MONTH)
    val day = c.get(Calendar.DAY_OF_MONTH)


    val dpd = DatePickerDialog(this, DatePickerDialog.OnDateSetListener {
            view, year, monthOfYear, dayOfMonth ->


    }, year, month, day)

    dpd.show()
 }
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Mark
  • 79
  • 2
  • 9

2 Answers2

1

By default datepicker is inheriting color

create style and use different colorAccent you can find details here

Change DatePicker background color

Djaf
  • 256
  • 1
  • 6
1

DatePicker shows highlights with accent color. Looks like you have accent color in theme set to white. Check your color file.

karan
  • 8,637
  • 3
  • 41
  • 78