1

I just want to remove the animation on the offset. Is something like this possible ? If you do not remove that animation, when I scroll as in the image below, the visual animation will go into effect and a hitch occurs.

remove the animation on the offset. I just want to add animation on the frame.

Gif is here.

GeometryReader { geometryReader in
                Image(movie.poster)
                    .resizable()
                    
                    .animation(.none)
                    .offset(x: self.isOpeningDetailView ? -35 : -geometryReader.frame(in: .global).minX)
                    
                    .animation(.easeInOut)
                    .frame(width: width,height: self.isProfileViewOpen ? height * 0.60 : height * 0.70, alignment: .trailing)
                
            }
Ufuk Köşker
  • 1,288
  • 8
  • 29

1 Answers1

0

Provided code is not testable, so just try the following

GeometryReader { geometryReader in

    Image(movie.poster)
        .resizable()
        .offset(x: self.isOpeningDetailView ? -35 : -geometryReader.frame(in: .global).minX)
        .frame(width: width,height: self.isProfileViewOpen ? height * 0.60 : height * 0.70, alignment: .trailing)
        .animation(.easeInOut, value: self.isProfileViewOpen)    // << here !!
    
}
.animation(.none) // and I added this code.
Ufuk Köşker
  • 1,288
  • 8
  • 29
Asperi
  • 228,894
  • 20
  • 464
  • 690