简体   繁体   English

SwiftUI 如何链接 2 个动画?

[英]SwiftUI how to chain 2 animations?

I'm trying to animate a line moving in a circle then using this library to add a second shimmer animation.我正在尝试为一条在圆圈中移动的线设置动画,然后使用此库添加第二个微光 animation。 The problem is they never both work, either one or the other will animate depending how if conditionIsTrue how can I chain them so that they work in succession?问题是它们永远不会同时工作,其中一个或另一个将根据如果conditionIsTrue如何进行动画处理,我如何链接它们以便它们连续工作?

                      Circle()
                        .animation(.linear, value: 0.8)
                        .if(conditionIsTrue)) { $0.shimmering(active: true, duration: 0.9, bounce: false) }

Currently no chaining animation in SwiftUI.目前在 SwiftUI 中没有链接 animation。 You can add a delay to the shimmering animation to run it after the first animation您可以在闪烁的 animation 中添加延迟,以便在第一个 animation 之后运行它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM