本文介绍了Nil与预期的参数类型UIViewAnimationOptions不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚开始编程并在线阅读教程我无法创建此动画。任何人都可以告诉我它为什么这样说:
I just started programming and following a tutorial online I was unable to create this animation. Can anyone tell me why it's saying:
以及如何解决?
view.addSubview(myFirstLabel)
UIView.animateWithDuration(0.5, delay: 0.0, usingSpringWithDamping: 0.0, initialSpringVelocity: 0.0, options: nil, animations: {
self.myFirstLabel.center = CGPoint(x: 100, y:40 + 200)
}, completion: nil)
推荐答案
您可以替换 options:nil
with options:[]
应该让错误发生。
You may replace options: nil
with options: []
should make the error goes way.
祝你好运!
这篇关于Nil与预期的参数类型UIViewAnimationOptions不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!