Compose DatePicker is taking empty space even if the title and headline are empty.
It's already published as a bug: https://issuetracker.google.com/issues/267194809
DatePicker:
DatePicker(
state = rememberDatePickerState(),
modifier = Modifier.fillMaxWidth(),
title = {
// empty
},
headline = {
// empty
}
)
Hope this solution will remove the empty space.
Just type 'null' in the title and headline;
Then, you need to put 'false' in the showModeToggle parameter.
Here is the solution:
DatePicker(
state = rememberDatePickerState(),
modifier = Modifier.fillMaxWidth(),
title = null,
headline = null,
showModeToggle = false
)