I have tried multiple implementations of a scroll view to handle a keyboard's presence, including apple's own. I can't get any of them to work.

I have a view that requires no scrolling when the keyboard is not displayed, but once a text field is the first responder, and the keyboard displays, some content needs to be scrollable.

Note that the only editable text field is the first on the screen, so I do not need to scroll the view to unhide anything - I just need scrolling ability in the top half of the screen, but only when the keyboard is displayed.

This is as close as I can get:

I can successfully register for keyboard notifications. On loading, I am setting my scrollview and content size to the full height of the view. When the keyboard displays, I resize the scrollview to the original height minus the keyboard height:

```
scrollView.frame = CGRectMake(0, 0, 320, 416 - kbSize.height);

```

And on hide, I simply reset it:

```
scrollView.frame = CGRectMake(0, 0, 320, 416);

```

This almost works. Except, once the keyboard is displayed, if I scroll down to the bottom of the view (keeping the keyboard displayed) and then hide the keyboard using its return key, when the scroll view resizes there is an inelegant 'jump' back to the top of the screen. There is no smooth animated scrolling to resize the scrollview.

Any ideas? I think I am making a hack of this compared to Apple's implementation, but it is the closest I have got.