Respond to CR.

pull/2/head
Matthew Chen 6 years ago
parent 6fe3ce6d87
commit ff08919206

@ -204,9 +204,6 @@ UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
// bar. // bar.
CGFloat offset = -MAX(0, (self.view.height - self.bottomLayoutGuide.length - keyboardEndFrameConverted.origin.y)); CGFloat offset = -MAX(0, (self.view.height - self.bottomLayoutGuide.length - keyboardEndFrameConverted.origin.y));
// UIKit by default animates all changes in response to keyboard events.
// We want to suppress those animations if the view isn't visible,
// otherwise presentation animations don't work properly.
dispatch_block_t updateLayout = ^{ dispatch_block_t updateLayout = ^{
if (self.shouldBottomViewReserveSpaceForKeyboard && offset >= 0) { if (self.shouldBottomViewReserveSpaceForKeyboard && offset >= 0) {
// To avoid unnecessary animations / layout jitter, // To avoid unnecessary animations / layout jitter,
@ -223,6 +220,9 @@ UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
if (self.shouldAnimateBottomLayout && CurrentAppContext().isAppForegroundAndActive) { if (self.shouldAnimateBottomLayout && CurrentAppContext().isAppForegroundAndActive) {
updateLayout(); updateLayout();
} else { } else {
// UIKit by default animates all changes in response to keyboard events.
// We want to suppress those animations if the view isn't visible,
// otherwise presentation animations don't work properly.
[UIView performWithoutAnimation:updateLayout]; [UIView performWithoutAnimation:updateLayout];
} }
} }

Loading…
Cancel
Save