OK, I know I can read the keyboard size using the notification UIKeyboardWillShowNotification and this
keybSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
but this will just be available when the keyboard shows.
but the problem is this: I have a window that has to adjust itself to a new position when the keyboard is visible and when iPhone rotates. When I rotate the iPhone both delegates method willRotateToInterfaceOrientation and didRotateFromInterfaceOrientation run and handle the rotation. Inside these methods I need to know the current keyboard height, so I can position the view properly. The problem is that the method fired by the UIKeyboardWillShowNotification notification runs after the rotation was handled by the delegate methods.
The order the methods run is:
- willRotateToInterfaceOrientation
- didRotateFromInterfaceOrientation
- UIKeyboardWillShowNotification method
In other words, the keyboard height is just read at the end, what means both methods 1 and 2 will use the old keyboard height.
My question is: is there a way to read the keyboard height of a visible keyboard directly instead of relying in methods fired by notifications?
thanks