Tastaturtypen und IME-Aktionen
Zeigen Sie die passende Tastatur und Senden-Schaltfläche an.
Tastaturtypen und IME-Aktionen ist eine kostenlose Jetpack Compose Academy-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Jetpack Compose Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Jetpack Compose Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
The Right Keyboard Matters
Asking for a phone number? Show a number pad, not letters. The right keyboard makes typing fast and error-free. 📱
keyboardOptions
You shape the keyboard through keyboardOptions. It lets you pick the key layout and the action button shown on it.
TextField(
value = phone,
onValueChange = { phone = it },
keyboardOptions = KeyboardOptions(/* ... */)
)Pick a keyboardType
Set keyboardType to match the data: Number for digits, Email for addresses, Phone for dialing.
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Email
)Common Keyboard Types
Handy choices include Text, Number, Phone, Email, Decimal, and Password. Each one tweaks the keys to fit the input.
Hide Password Characters
For secrets, pair the Password type with a visualTransformation so each character shows as a dot. 🔒
visualTransformation = PasswordVisualTransformation()IME Actions
The imeAction sets the keyboard's main button. Choose Next to move to the following field or Done to finish a form.
keyboardOptions = KeyboardOptions(
imeAction = ImeAction.Next
)Common IME Actions
Frequent actions are Next, Done, Search, Send, and Go. They tell the user what tapping the button will do.
React with keyboardActions
Respond to that button using keyboardActions. Run a search, submit the form, or jump focus to the next field.
keyboardActions = KeyboardActions(
onDone = { submitForm() }
)Move Focus on Next
For multi-field forms, use the FocusManager to move to the next input when the user taps Next.
keyboardActions = KeyboardActions(
onNext = { focusManager.moveFocus(FocusDirection.Down) }
)Type and Action Work Together
Set the keyboardType and imeAction together for each field. The result feels polished and effortless to fill in.
Small Touches, Big Polish
Matching the keyboard and its action to each field is a tiny effort that gives your forms a truly professional feel.
Quick Check
Which option controls the action button shown on the keyboard?
Recap
You tuned the keyboard: keyboardType picks the keys, imeAction labels the button, and keyboardActions responds to it. Smooth typing all around. 🎯
Häufig gestellte Fragen
Ist die Lektion „Tastaturtypen und IME-Aktionen“ kostenlos?
Ja — der vollständige Text von „Tastaturtypen und IME-Aktionen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Jetpack Compose Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Jetpack Compose Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Tastaturtypen und IME-Aktionen“?
Zeigen Sie die passende Tastatur und Senden-Schaltfläche an. Du übst Jetpack Compose Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Jetpack Compose Academy zu starten?
Keine Vorkenntnisse erforderlich. Jetpack Compose Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.
Wie lange dauert die Lektion „Tastaturtypen und IME-Aktionen“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Jetpack Compose Academy-Lektion Code schreiben und ausführen?
Ja. Jede Jetpack Compose Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- TextField und OutlinedTextField
- Labels, Platzhalter und führende Icons
- Tastaturtypen und IME-Aktionen
- Inline-Validierung und Fehlerzustände