collapseCorpse
collapseCorpse

Reputation: 57

MonthNavigation buttons color in Material3 DatePicker

I'm unable to change color of month navigation buttons in jetpack compose DatePicker:

enter image description here

Tried modifying theme colors and managed to change the color of everything except the buttons.

Upvotes: 0

Views: 534

Answers (1)

Chirag Thummar
Chirag Thummar

Reputation: 3242

In Material3 DatePicker you can change color using selectedDayContainerColor and set your desired color.

Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
       
        val datePickerState = rememberDatePickerState(initialSelectedDateMillis = 1578096000000)
        DatePicker(state = datePickerState, modifier = Modifier.padding(16.dp),
            colors = DatePickerDefaults.colors(
                navigationContentColor = Color.Red
            ))

        Text("Selected date timestamp: ${datePickerState.selectedDateMillis ?: "no selection"}")
    }

You can change the whole horizontal container colour using the above code there is no option for change color only for MenuButton

Output

Upvotes: 1

Related Questions