Skip to content

Commit 67b65a1

Browse files
committed
Forces layout without implicit animation before animating constraint update.
1 parent e8d6bf2 commit 67b65a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

KeyboardConstraint/KeyboardAdjustConstraint.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ - (void)_keyboardDidChangeVisible:(NSNotification *)notification
5454
CGFloat keyboardHeight = CGRectGetMaxY(windowRelativeFrame) - CGRectGetMinY(endFrame);
5555

5656
if (superview) {
57+
//Force layout before animation...
58+
[CATransaction begin];
59+
[CATransaction setDisableActions:YES];
60+
[superview layoutIfNeeded];
61+
[CATransaction commit];
62+
5763
[UIView animateWithDuration:animationDuration
5864
delay:0
5965
options:animationOptions|UIViewAnimationOptionLayoutSubviews

0 commit comments

Comments
 (0)