【发布时间】:2015-09-27 13:53:33
【问题描述】:
我在视图中间添加了一个ImageView(没有设置约束)。
使用此代码,我想将此 ImageView 从其原始位置移动到新位置。
不幸的是,它从新位置移动到原来的位置 - 为什么?
let opts = UIViewAnimationOptions.CurveEaseInOut
UIView.animateWithDuration(1, delay: 0, options: opts, animations: {
self.ivSun.center.x += 100
}, completion: nil)
【问题讨论】:
-
你的意思是动画完成后回到原点还是跳到x + 100然后动画回到原点?
-
你多久使用一次这个动画?你经常重复吗?
标签: ios swift cocoa-touch animation uiimageview