UIKit text input components, such as UITextView
and UITextField
have a property inputView
to add a custom keyboard. There are two questions I have relating to this.
If the keyboard is currently visible and the property is set to a new input view, nothing happens. Resigning and regaining first responder status refreshes the input and displays the new view. Is this the best way to do it? If so it might answer my bigger question:
Is it possible to animate the transition between two input views?
If you're on Android you'll want to use keyboardDidShow and keyboardDidHide instead. When the keyboardWillShow event is emitted you'll set an animated variable to the final height of the keyboard and have it animate for the same duration as the keyboard sliding animation.
You can use ScrollView to control screen up and down movements. As long as user hasn't focused any TextInput , you can disable scroll. On focus, just shift up the scrollview using Content Offset prop. Hope it helps!
TextInput is a Core Component that allows the user to enter text. It has an onChangeText prop that takes a function to be called every time the text changed, and an onSubmitEditing prop that takes a function to be called when the text is submitted.
You can use KeyboardAwareScrollView .
From the UIResponder docs:
Responder objects that require a custom view to gather input from the user should redeclare this property as readwrite and use it to manage their custom input view. When the receiver subsequently becomes the first responder, the responder infrastructure presents the specified input view automatically. Similarly, when the view resigns its first responder status, the responder infrastructure automatically dismisses the specified view.
So unfortunately the answer to 1 is Yes and 2 is No.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With