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,352
  • 21
  • 80
  • 110
Mark
  • 69
  • 1
  • 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
  • 226
  • 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,812
  • 3
  • 41
  • 76