我希望改变datePicker Dialog的颜色,但我不知道如何做到。我找到了一些关于它的资料,但还没有关于jetpack compose的,你能帮我吗?这是我的DatePicker Dialog代码:
val context = LocalContext.current
val year: Int
val month: Int
val day: Int
val calendar = Calendar.getInstance()
year = calendar.get(Calendar.YEAR)
month = calendar.get(Calendar.MONTH)
day = calendar.get(Calendar.DAY_OF_MONTH)
val datePickerDialog = DatePickerDialog(
context,
{ _: DatePicker, year: Int, month: Int, dayOfMonth: Int ->
onDateChange("$dayOfMonth/${month + 1}/$year", day, month, year)
}, year, month, day
)
CustomInputField(
isFocused = isInputFocused,
placeholder = "Your Birty Day ",
currentValue = state.date,
onClick = {
onPickerStateChange(BirthDayPickerState.BIRTHDAY)
datePickerDialog.show()
})
这是我的所有日期选择器对话框代码。我没有分享它,因为我认为并不是所有的代码都是必要的,我只想分享必要的代码。让我快速解释一下,我有一个自定义输入字段customInputField,它类似于文本字段。当我点击customInputField时,DatePicker对话框会打开,我选择用户的出生日期,并将其显示在customInputField中作为用户的出生日期,但我想更改这个DatePicker对话框,因为我不喜欢它。你有什么建议吗?