The answer to this question proved to be really simple. There's a great working awesome library on GitHub built right for this. It works flawlessly and requires no code at all. Check it out - https://github.com/cotap/TAPKeyboardPop
Recreate sliding out keyboard in iOS7
-
10-06-2023 - |
質問
There's a great effect in iOS 7
native messages app
when we use iOS7
's new interactivePopGestureRecognizer
to pop the view in UINavigationController
when the keyboard is open. It looks like this:
Note that the keyboard belongs to the previous ViewController, it sticks to it and it feels right.
However, no matter how hard I try the keyboard in my app behaves like this:
I don't modify the code at all, but even if I do put [self.view endEditing:YES];
somewhere in the code (e.g. viewWillDissapear
or viewDidDissappear
) - it just hides the keyboard but doesn't make it stay like in the example above.
I don't think that the approach of making a screenshot of the keyboard and placing the image is the right one, it will definitely slow down the process and won't feel fluid at all.
Any suggestions on how to mimc this kind of behavior are welcome.
解決