ios – 使用Facebook pop的动画限制?

我能够使用约束更改设置动画
[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,如上所示.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...