加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 如何在swift中动画内容(xcode 6 beta)

发布时间:2020-12-14 18:06:46 所属栏目:百科 来源:网络整理
导读:我想知道如何用苹果的新语言快速动画. 在目标c中,我将使用以下代码将图像从屏幕顶部移动到结尾: [UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ UIImageView.center = CGPointMake(UIImageView.center.x,U
我想知道如何用苹果的新语言快速动画.

在目标c中,我将使用以下代码将图像从屏幕顶部移动到结尾:

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
    UIImageView.center = CGPointMake(UIImageView.center.x,UIImageView.center.y + 200);
} completion:^(BOOL finished) {
    [self move];
}];

所以questoin是:

>我如何使用与上面的代码(obj c)相同的效果在swift中制作动画,
我会很感激你对这种方式的解释.

解决方法

UIView.animateWithDuration(1,delay: 0,options: .CurveLinear,animations: {
    UIImageView.center = CGPointMake(UIImageView.center.x,UIImageView.center.y + 200);
},completion: {
    (finished: Bool) in
    move();
});

这是怎么回事.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读