I need to scroll my scrollView when textFiewl is being listened, which is below the virtual keyboard. I call [self.scrollView setContentOffset:scrollPoint animated:YES]; . To get the visible area of ββthe screen, I obviously need a KB size.
I am familiar with
NSDictionary *info = [notification userInfo]; CGSize kbSize = [self.view convertRect: [info[UIKeyboardFrameBeginUserInfoKey] CGRectValue] fromView:nil].size;
however, this does not work for me, because when a user types a possibly half-covered text field, I do not receive keyboard notifications.
So, I call the method in textFieldDidBeginEditing: which is called before the keyboard sends a message, and therefore I do not know the KB size on the first press.
So, the question arises: is it possible to get the size of the KB without calling the corresponding notification? Programmatically, not hardcoding.
source share