UITextView is a subview of a modal controller. I need to reduce the height of the UITextView when the keyboard appears so that the coordinate of the lower border y of the UITextView is equal to the coordinate of the upper axis of the keyboard. I'getting height height
CGRect frameBegin = [[notification.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue] ; CGRect frameEnd = [[notification.userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect resultBegin = [self.view convertRect:frameBegin fromView:nil]; CGRect resultEnd = [self.view convertRect:frameEnd fromView:nil]; CGFloat kbdHeight = resultBegin.origin.y - resultEnd.origin.y;
The problem is that this modal view jumps up when the keyboard appears. How to calculate the coordinate of the upper border of the keyboard in this case?
Michael
source share