ios – Xcode 6.1:UIView.animateWithDuration额外参数’usingSpringWithDamping’

前端之家收集整理的这篇文章主要介绍了ios – Xcode 6.1:UIView.animateWithDuration额外参数’usingSpringWithDamping’前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我不知道为什么错误,“额外的参数’在调用中使用 SpringWithDamping’突然出现在下面.

我刚刚开始,所以任何帮助将不胜感激!

UIView.animateWithDuration(1.0,delay: 0,usingSpringWithDamping: 1.5,initialSpringVelocity: 5.0,options: UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.AllowUserInteraction,animations: {
            self.view.backgroundColor = newColor
            self.funFactLabel.transform = CGAffineTransformMakeScale(1.25,1.25)
        },completion: { finished in
            UIView.animateWithDuration(2.0,usingSpringWithDamping: 0.5,options: nil,animations: {
                    self.funFactLabel.transform = CGAffineTransformMakeScale(1.0,1.0)
                }
            )},completion: nil
    )

解决方法

试试这个:

UIView.animateWithDuration(1.0,animations: {
        self.view.backgroundColor = newColor
        self.funFactLabel.transform = CGAffineTransformMakeScale(1.25,1.25)
    },completion: { finished in
        UIView.animateWithDuration(2.0,animations: {
                self.funFactLabel.transform = CGAffineTransformMakeScale(1.0,1.0)
            },completion: nil)
    })

猜你在找的Xcode相关文章