I have a view controller showing a view with a UITextView, and I want to resize the view when the keyboard appears so that the UITextView is not covered by the keyboard. I work correctly in all cases. I still see some oddities on the iPad only when the view controller is presented in the ModalPresentationStyleFormSheet and only in the LandscapeRight orientation, as far as I can tell.
The relevant parts of the controller of my kind are -keyboardWillShow:
- [UIView boundsInWindow]:
- (CGRect)boundsInWindow { UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; CGRect bounds = [self convertRect:self.bounds toView:self.window]; if (UIInterfaceOrientationIsLandscape(orientation)) {
It works, most of the time. When my application is in the LandscapeRight UI orientation, although the origin I get from -boundsInWindow is slightly lower than it should be. What could be the reason for this?
Thanks for any help!
source share