Skip to content

Instantly share code, notes, and snippets.

@pashields
Created September 7, 2011 23:11
Show Gist options
  • Save pashields/1202085 to your computer and use it in GitHub Desktop.
Save pashields/1202085 to your computer and use it in GitHub Desktop.
- (void)keyboardWillShow:(NSNotification *)notif {
if (self.scrollView.frame.size.height == 460-HEADER_BAR_HEIGHT-216) {
return;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
self.scrollView.frame = CGRectMake(0, HEADER_BAR_HEIGHT, 320, 460-HEADER_BAR_HEIGHT-216);
[UIView commitAnimations];
NSLog(@"contentOffset: %f", self.scrollView.contentOffset.y);
if ([self.lastNameField isFirstResponder]) {
CGPoint point = CGPointMake(0, 207);
self.scrollView.contentOffset = point;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment