iT邦幫忙

0

SwiftUI Xcode Bate IOS 17.0 ZStack bug

  • 分享至 

  • xImage

最近在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())
            )
    }
}
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
dryfirewood
iT邦見習生 ‧ 2023-09-20 16:04:04

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!

我要發表回答

立即登入回答