Two circles on Zstack is not align if view is render on NavigationView.
struct SpinnerView: View {
@State private var isLoading = false
var body: some View {
NavigationView {
ZStack {
Circle()
.stroke(Color(.systemGray5), lineWidth: 7)
.frame(width: 64, height: 64)
Circle()
.trim(from: 0, to: 0.2)
.stroke(Color.green, lineWidth: 7)
.frame(width: 64, height: 64)
.rotationEffect(Angle(degrees: isLoading ? 360 : 0))
.animation(Animation.linear(duration: 1).repeatForever(autoreverses: false))
.onAppear() {
self.isLoading = true
}
}
}
}
}