This is a quick unfancy way to do move the toolbar up. I'm sure you'll be able to adapt it to your needs.
First you have to register for the keyboard notifications
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
and then you move the toolbar up. Like this.
- (void)keyboardWillShow:(NSNotification *)notification {
if (keyboardShown) {
return;
}
NSDictionary* info = [notification userInfo];
// Get the size of the keyboard.
NSValue* aValue = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
CGSize keyboardSize = [aValue CGRectValue].size;
CGRect currentFrame = self.toolbar.frame;
currentFrame.origin.y = currentFrame.origin.y - keyboardSize.height;
[UIView beginAnimations:@"ShowKeyboard" context:NULL];
[UIView setAnimationCurve:[[info objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]];
[UIView setAnimationDuration:[[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
self.toolbar.frame = currentFrame;
[UIView commitAnimations];
keyboardShown = YES;
}
of course you have to create another method that will hide the keyboard, but this is basically the same as show keyboard, so I'll omit it.
To make things a little bit more easy you could make the toolbar and the webview subviews of a "content" view. You would then resize the height of the contentview and autoresizing will take care of the rest.
Oh and you should not resize the view just because of textFieldDidBeginEditing:
. I don't know for the iphone, but it's possible to connect an external keyboard to the ipad. And you would resize the view without the keyboard showing up, leaving a big blank frame at the bottom.