Reputation: 1
I'm trying to change the width of container of DatePickerDialog, but it never scales well when i try to change the width by modifier.width. I tried the sample implementation which is on android developer but couldn't move further with the width.. Thank you for all the answers.
val datePickerState = rememberDatePickerState() val confirmEnabled = derivedStateOf { datePickerState.selectedDateMillis != null } DatePickerDialog( modifier = Modifier.requiredWidth(200.dp), onDismissRequest = { openDialog = false }, properties = DialogProperties(usePlatformDefaultWidth = false), confirmButton = { TextButton( onClick = { openDialog = false }, enabled = confirmEnabled.value, colors = ButtonDefaults.buttonColors(),
) {
Text("OK")
}
},
dismissButton = {
TextButton(
onClick = {
openDialog = false
},
colors = ButtonDefaults.buttonColors()
) {
Text("Cancel")
}
},
colors = DatePickerDefaults.colors()
) {
DatePicker(state = datePickerState,
colors = DatePickerDefaults.colors())
}
this is my code
Upvotes: 0
Views: 484