iOS "Gboard" app, UIKeyboard notification height is wrong or invalid
Asked Answered
R

1

24

I'm trying to move the view up when the keyboard pops up over the UITextfield which is placed on UIScrollView. I'm using UIKeyboardWillShowNotification and UIKeyboardWillHideNotification for this.

It's working perfectly when using iOS Keyboard where I'm getting the height 297.

My client is using the Gboard keyboard, he complained that the view is not moving. When I tested, I'm getting the keyboard height as 44.

I've tried both keys UIKeyboardFrameBeginUserInfoKey and UIKeyboardFrameEndUserInfoKey for the NSNotifiction userInfo object. Both are giving 44 only.

I tried with UIKeyboardDidShowNotification and UIKeyboardDidHideNotification also, still same issue.

Could anyone help me with this..?

Radcliff answered 21/8, 2016 at 16:8 Comment(6)
Have a look at this post: #28813839 it might helpCoxalgia
@MrH, Thanks for the link :)... i've tried, but it's not working with UITableview. I've both UIScrollView and UITableViewRadcliff
please include code to get keyboard height in above questionArana
Use TPKeyboardManager. It works for both table view and scroll view.Rockie
Hm for custom keyboards the UIKeyboardFrameEndUserInfoKey should work.. Are you sure when you use UIKeyboardDidShowNotification and UIKeyboardFrameEndUserInfoKey it's still wrong? Perhaps this link might help as well: #15402781Picot
Also had this problem with RxKeyboard and Gboard, somewhat fixed it by using keyboard frame and not willShowVisibleHeight driver.Wandie
W
2

Its late, but UIKeyboardWillChangeFrameNotification is what U want.

Wardrobe answered 16/10, 2019 at 8:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.