Hello, I have an UIScrollView and in the lower part of the screen is a textfield. When I select the textfield the keyboard is displayed above the textfield. The UIView within the UIScrollView is not large enough to scroll up and free some space for the keyboard. So I've tried to enlarge the UIView programaticly. This is what I've got:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
UIScrollView *scrollView = (UIScrollView *)[[self view] viewWithTag: 2];
UIView *contentview = [[self view] viewWithTag: 3];
CGRect rect = contentview.frame;
rect.size.height = 650;
contentview.frame = rect;
[scrollView setContentSize: contentview.frame.size];
//first try
rect.origin.y = 450;
[scrollView scrollRectToVisible: rect animated: YES];
//second try
CGPoint point = CGPointMake(0, 450);
[scrollView setContentOffset: point animated: YES];
return YES;
}
thanks.