@Composable
fun InputText(
...
submit: () -> Unit = {}
) {
val keyboardController = LocalSoftwareKeyboardController.current
TextField(
...
keyboardOptions = KeyboardOptions.Default.copy(imeAction = ImeAction.Search),
keyboardActions = KeyboardActions(onDone = {
submit()
keyboardController?.hide()
})
)
}
'안드로이드 > Compose' 카테고리의 다른 글
[Compose] Side Effect와 Effect API(LaunchedEffect, rememberCoroutineScope 등) (0) | 2024.11.23 |
---|---|
[Compose] 목록 및 그리드 (0) | 2024.11.17 |
[Compose] TextField에 오류 메시지 표시하기 (0) | 2024.11.03 |