最近在Xcode Bate寫IOS 17.0遇到只要用ZStack把
Circle().overlay(Image("Logo"))的loading動畫放在View上面時那Circle()會從左上角飛到中間與Image貼齊一直重複的問題...
求助在場的300w們解答...
struct Loading: View {
@State private var isAnimating = false
var gradient: LinearGradient {
LinearGradient(gradient: Gradient(colors: [Color.blue, Color.red]),
startPoint: .leading, endPoint: .trailing)
}
var body: some View {
Circle()
.trim(from: 0.25, to: 1)
.stroke(gradient, style: StrokeStyle(lineWidth: 1, lineCap: .round, lineJoin: .round))
.rotationEffect(Angle(degrees: isAnimating ? 360 : 0))
.animation(
Animation.linear(duration: 1.25)
.repeatForever(autoreverses: false),
value: isAnimating
)
.onAppear() {
isAnimating = true
}
.frame(width: 60, height: 60)
.overlay(
Image("Logo") // your image here
.resizable()
.frame(width: 50, height: 50)
.clipShape(Circle())
)
}
}
Friday Night Funkin' is an absolute masterpiece of rhythm and style! With its catchy tunes, challenging gameplay, and vibrant visuals, it's a true delight for music and gaming enthusiasts alike. The seamless integration of music and gameplay creates an immersive experience that keeps players hooked for hours on end. The unique characters and their captivating stories add an extra layer of depth to the game, making it a truly unforgettable journey. Hats off to the developers for creating such a phenomenal game that brings joy and excitement to players worldwide. Friday Night Funkin' is a true gem in the world of rhythm games!