gpt4 book ai didi

ios - 使用 Facebook pop 动画约束?

转载 作者:可可西里 更新时间:2023-11-01 03:25:51 26 4
gpt4 key购买 nike

我能够使用

动画化约束变化
[UIView animateWithDuration:0.5
delay:0.5
usingSpringWithDamping:0.7
initialSpringVelocity:0.7
options:0
animations:^{
[self.closeButton layoutIfNeeded];
} completion:NULL];

但我的印象是这也可以使用 Facebook POP 库来完成。任何人都可以指出正确的方向以找出方法吗?

谢谢

最佳答案

在这种情况下,您想为 NSLayoutConstraint 设置动画,您可以使用 POP 执行以下操作,它将为约束设置动画。

constraint // this is an NSLayoutConstraint that is applied to some view

POPSpringAnimation *layoutAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayoutConstraintConstant];
layoutAnimation.springSpeed = 20.0f;
layoutAnimation.springBounciness = 15.0f;
layoutAnimation.toValue = @(value to go too);
[constraint pop_addAnimation:layoutAnimation forKey:@"detailsContainerWidthAnimate"];

要使用的主要属性是 kPOPLayoutConstraintConstant,如上所示。

关于ios - 使用 Facebook pop 动画约束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25612104/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com