你好我在互联网上搜索,但找不到任何东西。
例如。我有2个视图,让我们说view1和view2。两者都有topConstraint属性。
我可以通过设置来轻松制作动画:
view1.topConstraint.constant = 50;
view2.topConstraint.constant = 250;
[self.scrollView setNeedsUpdateConstraints];
[UIView animateWithDuration:5.0f animations:^{
[self.scrollView layoutIfNeeded];
}];
有没有办法以不同的延迟动画NSLayoutConstraints? E.g我想这样做
view1.topConstraint.constant = 50;
[UIView animateWithDuration:5.0f delay:0.0f options:0 animations:^{
[self layoutIfNeeded];
} completion:^(BOOL finished) {
}];
view2.topConstraint.constant = 250;
[UIView animateWithDuration:3.0f delay:2.0f options:0 animations:^{
[self layoutIfNeeded];
} completion:^(BOOL finished) {
}];
提前感谢所有帮助!