Having easy code like beneath, the animation of adjusting the picture and motion shouldn’t be displayed correctly. The picture shouldn’t be shifting along with the entire view, however fades out after which fades in within the vacation spot spot. Please see the picture.
struct AnimationTestView: View {
@State var chosen: Bool = false
var physique: some View {
HStack {
if !chosen {
Picture(systemName: "plus.circle")
.resizable()
.body(width: 50, peak: 50)
.background(Colour.inexperienced)
}
Picture(systemName: chosen ? "plus.circle.fill" : "plus.circle")
.resizable()
.body(width: 50, peak: 50)
.background(Colour.yellow)
.onTapGesture {
withAnimation {
chosen.toggle()
}
}
Spacer()
}
}
}