gpt4 book ai didi

uiviewanimation - 使用 Swift 的 UIView 动画选项

转载 作者:IT王子 更新时间:2023-10-29 05:01:31 27 4
gpt4 key购买 nike

如何在 UIView 动画 block 中将 UIViewAnimationOptions 设置为 .Repeat:

UIView.animateWithDuration(0.2, delay:0.2 , options: UIViewAnimationOptions, animations: (() -> Void), completion: (Bool) -> Void)?)

最佳答案

swift 3

和之前差不多:

UIView.animate(withDuration: 0.2, delay: 0.2, options: UIViewAnimationOptions.repeat, animations: {}, completion: nil)

除了你可以省略完整类型:

UIView.animate(withDuration: 0.2, delay: 0.2, options: .repeat, animations: {}, completion: nil)

你仍然可以组合选项:

UIView.animate(withDuration: 0.2, delay: 0.2, options: [.repeat, .curveEaseInOut], animations: {}, completion: nil)

swift 2

UIView.animateWithDuration(0.2, delay: 0.2, options: UIViewAnimationOptions.Repeat, animations: {}, completion: nil)

UIView.animateWithDuration(0.2, delay: 0.2, options: .Repeat, animations: {}, completion: nil)

UIView.animateWithDuration(0.2, delay: 0.2, options: [.Repeat, .CurveEaseInOut], animations: {}, completion: nil)

关于uiviewanimation - 使用 Swift 的 UIView 动画选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24081192/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com