My app uses a UIAccessoryView
to provide additional keyboard functionality (such as forward/backward tabs and arrows keys) for the virtual keyboard, but that causes
(This answer was suggested by Sean Heber on the Apple forums)
When you get a UIKeyboardDidShowNotification
, instead of using the frame given by UIKeyboardFrameEndUserInfoKey
, simply test where the view's accessory view is and use that, instead. All I do is check to see what the frame of the accessory view is and convert it to my own view's coordinate space. Then I can easily use that frame to decide what to do.
Note: When the on-screen keyboard is shown/hidden using the bluetooth keyboard's eject button, it seems that UIKit sends UIKeyboardDidShowNotification
again but not a UIKeyboardWillHideNotification
. This is also a confusing inconsistency, but the above workaround is still valid as the system will change the frame of the inputAccessoryView when it slides in the on-screen keyboard, so you can still adjust things accordingly.