// 花朵、序列、履带动画
struct ContentView: View {
// @State private var shouldRotate:Bool = false //是否旋转
// @State private var shouldScale:Bool = false //是否缩放
// @State var offsetX:CGFloat = 0 //位移距离
// let colors:[Color] = [.red,.orange,.yellow,.green,.blue]
// let animations:[Animation] = [Animation.interpolatingSpring(stiffness: 100, damping: 10),Animation.interpolatingSpring(stiffness: 100, damping: 10).delay(0.3),Animation.interpolatingSpring(stiffness: 100, damping: 10).delay(0.6),Animation.interpolatingSpring(stiffness: 100, damping: 10).delay(0.9),Animation.interpolatingSpring(stiffness: 100, damping: 10).delay(1.2)]
@State private var isAnimating = false
var body: some View {
// 花朵旋转动画
// FlowerCapsule()
// .scaleEffect(shouldScale ? 0.2:1)
// .rotationEffect(.degrees(shouldRotate ? 0 : 360),anchor: .
SwiftUI初级课程(三十四)花朵、序列、履带动画
于 2023-01-04 21:12:04 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)