TextField
でキーボードの決定アイコンを変える方法です。
.kt
@Composable
fun CopyButton() {
var text = remember { mutableStateOf("") }
TextField(
value = text.value,
onValueChange = { text.value = it },
label = { /*TODO*/ },
modifier = Modifier.padding(16.dp),
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Done,
)
)
}
こちらのコードのimeAction = ImeAction.Done
ここの部分で変更することが可能です。
ImeActionの種類
ImeAction | 画像 |
---|---|
None | |
Default | |
Go | |
Search | |
Send | |
Previous | |
Next | |
Done |