gpt4 book ai didi

ios - 使 UIViewPropertyAnimator 永不完成

转载 作者:搜寻专家 更新时间:2023-10-31 23:09:44 25 4
gpt4 key购买 nike

问题描述

我有一个 UIViewPropertyAnimator 管理模糊等,我只想将它用于它的 fractionComplete 属性。问题是,如果我将 fractionComplete 设置为 1.0,它会完成并删除我想保留的所有动画。

基本上,我不希望动画师完成,因为这会清除它的动画 block 。

考虑的解决方法

  • 完成后重新添加动画
  • fractionComplete 钳制为 0.001...0.999

最佳答案

现在可以使用 iOS11 进行设置

var pausesOnCompletion: Bool { get set }

关于 UIViewPropertyAnimator

When the value of this property is true, the animator remains in the active state when the animation finishes, and it does not execute its completion handler. Keeping the animator in the active state allows you to reverse the animation even after it has finished. When the value of this property is false, the animator automatically transitions to the inactive state when the animation finishes, thereby concluding the animation. The default value of this property is false.

来源:https://developer.apple.com/documentation/uikit/uiviewpropertyanimator/2909004-pausesoncompletion

关于ios - 使 UIViewPropertyAnimator 永不完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44334389/

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