弹键盘动画

必须在修改约束后调用 .superView layoutIfNeed:  否则没有动画效果

__weak typeof(self)wkSelf = self;
    self.inputTf.qmui_keyboardWillChangeFrameNotificationBlock = ^(QMUIKeyboardUserInfo *keyboardUserInfo) {
        wkSelf.checkMoreBtn.hidden = YES;
        [wkSelf moveUp];
        
        [UIView animateWithDuration:keyboardUserInfo.animationDuration delay:0 options:keyboardUserInfo.animationOptions animations:^{
            [wkSelf.allSendBtn mas_updateConstraints:^(MASConstraintMaker *make) {
                make.bottom.equalTo(-keyboardUserInfo.height);
            }];
            [wkSelf.allSendBtn.superview layoutIfNeeded];
        } completion:nil];
        
    };

 

posted on 2018-05-16 18:51  土匪7  阅读(106)  评论(0编辑  收藏  举报