Reputation: 57
I'm unable to change color of month navigation buttons in jetpack compose DatePicker:
Tried modifying theme colors and managed to change the color of everything except the buttons.
Upvotes: 0
Views: 534
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