Skip to content

Commit b02b9e2

Browse files
committed
Added 'setNeedsLayout' and 'layoutIfNeeded' to animate the content #160
1 parent b364276 commit b02b9e2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

IQKeyBoardManager/IQKeyboardManager.m

+10
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ -(void)setRootViewFrame:(CGRect)frame
422422
[UIView animateWithDuration:_animationDuration delay:0 options:(_animationCurve|UIViewAnimationOptionBeginFromCurrentState) animations:^{
423423
// Setting it's new frame
424424
[controller.view setFrame:frame];
425+
426+
//Animating content (Bug ID: #160)
427+
[controller.view setNeedsLayout];
428+
[controller.view layoutIfNeeded];
429+
425430
_IQShowLog([NSString stringWithFormat:@"Set %@ frame to : %@",[controller _IQDescription],NSStringFromCGRect(frame)]);
426431
} completion:NULL];
427432
}
@@ -984,6 +989,11 @@ - (void)keyboardWillHide:(NSNotification*)aNotification
984989
_IQShowLog([NSString stringWithFormat:@"Restoring %@ frame to : %@",[_rootViewController _IQDescription],NSStringFromCGRect(_topViewBeginRect)]);
985990
// Setting it's new frame
986991
[_rootViewController.view setFrame:_topViewBeginRect];
992+
993+
//Animating content (Bug ID: #160)
994+
[_rootViewController.view setNeedsLayout];
995+
[_rootViewController.view layoutIfNeeded];
996+
987997
} completion:NULL];
988998
_rootViewController = nil;
989999
}

0 commit comments

Comments
 (0)