Sunday, 15 September 2013

ios - When/How does a UITextView become a First Responder? -


I am new to iOS development and recently it has come to know that we always resign to make the on-screen screen disappear FirstResponder lecture philosophy should deliver The reason for this is the reason behind leaving the first reaction to the text scene, and therefore the keyboard disappears, because there is no need to answer the text view

although I have also noticed That is the first responder method to create a first answering answer. However, this method is never called on the text view.

My theory is that when no method is ever called (at least, by me) Before he can resign the first responder status, he is already the first responder.

the first resconder status is automatically controlled for you when a user Taps on the text field. As long as the user interaction is enabled for UITextField / UitextView , the keyboard should be visible when the tape is done.

You can monitor it by using the delegate method textViewDidBeginEditiing or more broadly, keyboard appearance notifications ( UIKeyboardWillShowNotification and UIKeyboardDidShowNotification ) for listening.

In addition to this, the relevant method before rear ponders (like calling a container view or setting a UIScrollViewKeyboardDismissMode of a scroll view Ways to sack without keyboards)

Note : In the simulator, it is possible that the keyboard still does not appear, even though these are all working properly. In this case, you want to make sure that Keyboard hardware has been toggled for simulator (CMD + K)


No comments:

Post a Comment