SnapKit / Masonry

Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
MIT License
18.05k stars 3.14k forks source link

mas_safeAreaLayoutGuideBottom animation issue #483

Open boboboa32 opened 6 years ago

boboboa32 commented 6 years ago

Issue Info

Info Value
Platform ios
Platform Version 11.0
Masonry Version 1.1.0
Integration Method cocoapods

Issue Description

First use mas_safeAreaLayoutGuideBottom to setup, then use mas_bottom to update constrains, animation not work, but if use mas_safeAreaLayoutGuideBottom the animation is ok. happened in keyboard show/hide animation.

- (void)handleKeyboardWillShow:(NSNotification *)noti {
    CGRect endFrame = [[noti.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
    CGFloat height = endFrame.size.height;
    [UIView animateWithDuration:duration animations:^{
        [self.sendView mas_updateConstraints:^(MASConstraintMaker *make) {
                // use mas_bottom because of iPhone x home indicator gap
                // see image below if use mas_safeAreaLayoutGuideBottom here
                make.bottom.equalTo(wself.view.mas_bottom).offset(-height);
        }];
        [self.view layoutIfNeeded];
    }];
}
d3b530e8-2f24-41ad-823f-1c6a1f4e0b49