I'm trying to mimic the UITextField
-keyboard relation in Whatsapp app.
As most of you know, there is a fixed UITextField
at the bottom of the screen and keyboard comes up as you tap the UITextField
. While keyboard is coming up, UITextField
stick to the keyboard and they slide together very smoothly.
Read Apple's documentation pages which is about moving views under the keyboard several times.
What I have tried so far:
Listened to keyboard notifications. I used both
setFrame:
andsetContentOffset:animated:
method within animation block. Didn't work as good as expected. TheUIViewAnimationCurve
value that keyboard animation has is 7, I couldn't find what it means asUIViewAnimationCurve
has only 4 integer enum type. I think animation curve of keyboard animation is not provided to developers, I hope I'm wrong.Using custom inputAccessoryView with lower z-index value. I had two exact
UIViews
, one is fixed at the bottom and the other is custominputAccessoryView
that was going to hide beneath the fixed one since it has lowerzPosition
value. Therefore, user wasn't going to see theinputAccessoryView
was coming up from outside of the screen but fixed view was being pushed up by keyboard. But no use, again. ChangingzPosition
value does not change anything.
At last, I thought Whatsapp might not be using system keyboard but a custom one. But if this is the case, it is a very very bad choice of design so that option is eliminated.
Anyone has an idea of how Whatsapp (or Hangouts) implemented that?