Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Scrollview offset when hiding keyboard #18

Merged
merged 1 commit into from

4 participants

@jgimenez

Sometimes the ViewController is not full screen (because it is contained in another ViewController). I found out that if it's small enough, the content needs to scroll when the keyboard appears, but it is not scrolled back when it disappears. The result is a white band on the bottom of the ViewController.

This patch fixes it.

@michaeltyson michaeltyson merged commit 1fd096b into from
@michaeltyson
Owner

Neat, cheers

@jgimenez

Thanks for this great piece of software BTW ;)

@michaeltyson
Owner
@jfradj

I think you should not set the Offset to Zero.
It's really weird/not user friendly to always reset the offset when the user already scroll to a specific position...

I totally agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 3, 2012
  1. @jgimenez
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  TPKeyboardAvoidingScrollView.m
View
1  TPKeyboardAvoidingScrollView.m
@@ -112,6 +112,7 @@ - (void)keyboardWillHide:(NSNotification*)notification {
[UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]];
[UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]];
self.contentInset = _priorInset;
+ self.contentOffset = CGPointZero;
[self setScrollIndicatorInsets:self.contentInset];
_priorInsetSaved = NO;
[UIView commitAnimations];
Something went wrong with that request. Please try again.