I currently change the scrollview size when the keyboard is active. I also use arrows to allow the user to quickly move to the next textfield. My scrollRectToVisible is not working properly in the vertical direction. It moves horizontally properly. I have been having a issue with my decimal pad
2014-09-12 10:29:24.039 TS[1895:455658] Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 1425143906_Portrait_iPhone-Simple-Pad_Default
I also stepped through the following code.
- (void)keyboardDidShow:(NSNotification *)n {
// Find top of keyboard input view
CGRect keyboardRect = [[[n userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
keyboardRect = [self.view convertRect:keyboardRect fromView:nil];
CGFloat keyboardTop = keyboardRect.origin.y;
// Resize scroll view
CGRect newScrollViewFrame = CGRectMake(0, 0, self.view.bounds.size.width, keyboardTop);
newScrollViewFrame.size.height = keyboardTop - self.view.bounds.origin.y;
[self.scrollView setFrame:newScrollViewFrame];
}
I have noticed that the keyboardRect is 244 for my decimal pad and 207 for my default keyboard. I am not sure how to fix this. Also this issue has only popped up in iOS 8. My app did not have any trouble in iOS 7. Thanks for the help.
UPDATE: I have found that when a textfield is initially selected the scrollview moves appropriately. When you then select another textfield while the keyboard is up is when the issue occurs. It appears that the scrollview resets its size to the original dimensions. Why would this happen? Is there a way to stop this from happening?