Uitextview is used for text input.
Methods Becomefirstresponder and Resignfirstresponder can be used to eject the system keyboard and to accept the system keyboard.
The system keyboard pops up and the text input box gets focus. Accept the system keyboard and the text input box loses focus. So, here's the problem.
Under certain conditions, such as clicking on a button on the interface, the custom keyboard is displayed. Tap again to switch to the system keyboard.
Accept the system keyboard first and then display the custom keyboard. For example, move the frame.y of a custom keyboard view. However, because the system keyboard is received, the input box in this article loses focus.
Although the custom keyboard is displayed. But the user experience is not good. The cursor is not flashing. The contents of the custom keyboard input cannot be inserted into the text input box accurately.
Workaround: (see iOS development documentation)
@property (ReadWrite, retain) UIView *inputview
If The value is nil, the text view displays the standard system keyboard when it becomes first responder. Assigning a custom view to the This property causes the view to be presented instead.
The default value of the is nil.
This property means
1. Display the system keyboard for nil.
2. Show custom keyboard for custom view.
Note to refresh.
-(void) reloadinputviews
Can use this method to refresh the custom input view or input accessory view associated with the current object when I T is the first responder. The views were replaced Immediately-that is, without animating them to place. If the current object isn't the first responder, this method has no effect.
Solve the problem perfectly.
The text input box always gets the focus. Customize keyboard and system keyboard to switch freely.
iOS custom keyboard and system keyboard toggle and text input box always gets focus