Mark
Mark

Reputation: 79

Date picker bug

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()
 }

Upvotes: 0

Views: 83

Answers (2)

karan
karan

Reputation: 8843

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

Upvotes: 1

Djaf
Djaf

Reputation: 256

By default datepicker is inheriting color

create style and use different colorAccent you can find details here

Change DatePicker background color

Upvotes: 1

Related Questions