动画

约束动画 一直出不来

正确的姿势

- (void)testViewAnimate {
    [self.testView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(self.height - 40 - 50);
    }];
    
    [UIView animateWithDuration:1 animations:^{
        [self.testView.superview layoutIfNeeded];
    }];
}

必须是 superview 调用 layoutIfNeeded

 

第二种正确姿势: 改frame

- (void)testViewAnimate {
    [UIView animateWithDuration:1 animations:^{
        self.testView.height = self.height - 40 - 50;
    }];
}

 

posted on 2017-05-19 11:15  土匪7  阅读(102)  评论(0编辑  收藏  举报