I have an application where the login screen moves the username/password fields up by resizing the main view when the keyboard is shown.
The problem is that if I suspend the app (clicking the home button) while the keyboard is visible and then bring the application back, it will “reset” the view size (as per the NIB), but the keyboard will still be visible, meaning that part of the “form” becomes hidden by the keyboard.
Does anyone have any suggestions for the best way to either hide the keyboard whenever the application returns from a suspended state (I know applicationDidBecomeActive gets called on my app delegate), or make sure that the view remains resized?
Thanks in advance!
Subscribe the
UIApplicationDidEnterBackgroundNotificationnotification (viaaddObserver:selector:name:object:selector ofNSNotificationCenter) and call[element resignFirstResponder].I’m not sure whether it’ll go down smoothly since the keyboard always animates when hiding, but at least it’ll get the job done.