首页 > 解决方案 > 如何在swift中从下到上为特定标签设置动画

问题描述

我想从下到上为标签设置动画。

我正在使用此代码

 UIView.animate(withDuration: 2, delay: 0, options: [.curveEaseOut], 
animations: {
    quoteLbl.center.y -= self.view.bounds.height - 100
    self.view.layoutIfNeeded()
}, completion: nil)

但是这段代码为整个视图设置动画,我想为 UIViewController 的特定标签设置动画

标签: swiftanimation

解决方案


推荐阅读