我正在使用Jetpack Compose的
TextField
,我希望在用户按下操作按钮(imeActionPerformed
参数)时关闭虚拟键盘。val text = +state { "" }
TextField(
value = text.value,
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Done,
onImeActionPerformed = {
// TODO Close the virtual keyboard here <<<
}
onValueChange = { s -> text.value = s }
)