Как DatePickerDialog может находиться над содержимым?Android

Форум для тех, кто программирует под Android
Anonymous
Как DatePickerDialog может находиться над содержимым?

Сообщение Anonymous »


При использовании

Код: Выделить всё

DatePickerDialog
it is above other content even if one does not use a layout around it. How is that possible?
Sample code:

Код: Выделить всё

    OutlinedTextField(
enabled = true,
singleLine = true,
modifier = Modifier.fillMaxWidth(),
placeholder = { Text("field 1") },
value = "",
onValueChange = {}
)

OutlinedTextField(
enabled = true,
singleLine = true,
modifier = Modifier.fillMaxWidth(),
placeholder = { Text("field 2") },
value = "",
onValueChange = {}
)

OutlinedTextField(
enabled = true,
singleLine = true,
modifier = Modifier.fillMaxWidth(),
placeholder = { Text("field 3") },
value = "",
onValueChange = {}
)

val datePickerState = rememberDatePickerState()
val showDialog = rememberSaveable { mutableStateOf(true) }

if(showDialog.value) {
DatePickerDialog(
onDismissRequest = { /* kein cancel wenn außerhalb des Dialogs tippe */ },
confirmButton = {
TextButton(onClick = {}) {
Text("ok")
}
},
dismissButton = {
TextButton(onClick = { }) {
Text("cancel")
}
}
) {
DatePicker(state = datePickerState)
}
}
Result:
Изображение



Источник: https://stackoverflow.com/questions/781 ... he-content

Вернуться в «Android»