Hello and thanks for reading my post. My problem is following: When I start an try to do an loading indicator animation there is an unwanted movement. The Circle should stay in Place and rotate (like a indicator should do), but in my case it move slightly upwards and resets at the end of animation and starts to move upward again. It makes absolutely no sense to me! If there is any solution, I will try it! It looks like this:
Here is my Code:
ZStack {
Circle()
.stroke(Color(.systemGray5), lineWidth: 40)
.frame(width: 250, height: 250)
.animation(nil)
Circle()
.trim(from: 0, to: 0.2)
.stroke(Color.gray, lineWidth: 40)
.frame(width: 250, height: 250)
.rotationEffect(Angle(degrees: isCircleRotating ? 360 : 0))
//I guess this is where the problem happens
.animation(Animation.linear(duration: 1).repeatForever(autoreverses: false))
.onAppear() {
self.isCircleRotating = true
}
}