layout布局动画不生效问题

2018-05-21  本文已影响4人  iOSCoder_XH

动画不生效调用方式如下:

    
    [UIView animateWithDuration:1 animations:^{
        self.constraint.constant = height;
        [self.view layoutIfNeeded];
    }completion:^(BOOL finished) {
        
    }];

修改方式如下:

[UIView animateWithDuration:1 animations:^{
        self.constraint.constant = -height;
        [self.view layoutIfNeeded];
    }completion:^(BOOL finished) {
        
    }];
上一篇下一篇

猜你喜欢

热点阅读