Okay... here's the working code:
Setup:
Interface:
View:
-NavigationBar
-(ImageView,etc.)
-ScrollView:
.......... -TextFields,etc.
ViewController:
Code:
IBOutlet UIScrollView *scrollView;
Connect:
- The view outlet to your 'main' view (not the scrollview!)
- The textFields' delegates to your viewController
- The scrollView Outlet to your Scrollview
In the implementation you have to add the following delegate methods:
Code:
-(void)textFieldDidBeginEditing:(UITextField *)textField {
NSLog(@"preparing to show keyboard");
scrollView.frame = CGRectMake(0,44,320,200); //44:NavigationBar ; 200: Keyoard
[scrollView scrollRectToVisible:textField.frame animated:YES]; //Oddly enough, it only works with the animation...
}
Code:
-(void)textFieldDidEndEditing:(UITextField *)textField {
NSLog(@"prepare to hide keyboard");
scrollView.frame = CGRectMake(0,44,320,416); //original setup
}
I hope this will help somebody.