https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
d

Dennis

03/15/2024, 2:39 PM
Hello how do i dismiss the ios numeric keyboard after typing. The characters keyboard have a done button that dismisses the keyboard. the done button is missing in the numeric keyboard, kindly assist
t

tylerwilson

03/15/2024, 2:46 PM
The iOS numeric keyboard does not include a 'done' button, so what is typically done is that you have to add your own UIToolbar with a Done button to it. This is often done by attaching an input Accessory to the UITextField. But in the CMP case, this is not possible. What I did was hook into the local notifications for keyboard hide and show. It does not do the right animation as yet, but it works. Also note it uses SnapKit, which can be replaced with raw iOS constraint code if needed.
Call setupKeyboard from your viewDidLoad.
d

Dennis

03/15/2024, 2:48 PM
Thank you so much Tyler
👍 1
6 Views