Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for 'keyboardWillChangeFrame' #97

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
修复问题
  • Loading branch information
NianJi committed Jun 10, 2014
commit 7a9959de6c46cc3274e1d6e45451316bbcea2855
6 changes: 3 additions & 3 deletions TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)TPKeyboardAvoiding_keyboardWillShow:(NSNotification*)notification {

UIView *firstResponder = [self TPKeyboardAvoiding_findFirstResponderBeneathView:self];

state.keyboardRect = [self convertRect:[[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
state.keyboardRect = [[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue];
state.keyboardVisible = YES;
state.priorInset = self.contentInset;
state.priorScrollIndicatorInsets = self.scrollIndicatorInsets;
Expand Down Expand Up @@ -92,7 +92,7 @@ - (void)TPKeyboardAvoiding_keyboardWillChangeFrame:(NSNotification *)notificatio

UIView *firstResponder = [self TPKeyboardAvoiding_findFirstResponderBeneathView:self];

state.keyboardRect = [self convertRect:[[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
state.keyboardRect = [[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue];
state.keyboardVisible = YES;

if ( [self isKindOfClass:[TPKeyboardAvoidingScrollView class]] ) {
Expand Down Expand Up @@ -269,7 +269,7 @@ - (UIEdgeInsets)TPKeyboardAvoiding_contentInsetForKeyboard {
TPKeyboardAvoidingState *state = self.keyboardAvoidingState;
UIEdgeInsets newInset = self.contentInset;
CGRect keyboardRect = state.keyboardRect;
newInset.bottom = keyboardRect.size.height - (CGRectGetMaxY(keyboardRect) - CGRectGetMaxY(self.bounds));
newInset.bottom = keyboardRect.size.height - (CGRectGetMaxY(keyboardRect) - CGRectGetMaxY(self.frame));
return newInset;
}

Expand Down