hello all, is my first question.
I try to scale LottieFile animation I would like to shrink a Lottie animation because it takes up the whole screen, I would like to be able to place it in a specific place and a specific size, I tested several solutions, I can't do it.
here is my code
@Binding var animationInProgress: Bool
func makeUIView(context: Context) -> some AnimationView {
let lottieAnimationView = AnimationView(name:"31626-e-mail")
lottieAnimationView.frame = CGRect(x: 1, y: 1, width: 50, height: 50)
lottieAnimationView.contentMode = .scaleAspectFit
lottieAnimationView.loopMode = .loop
lottieAnimationView.play { complete in
if complete {
animationInProgress = false
}
}
return lottieAnimationView
}
func updateUIView(_ uiView: UIViewType, context : Context){
}
}
and my contentView
@State var animationInProgress = false
var body: some View {
VStack{
Text("My fruit Shop").font(.title).bold()
Image("Fruit")
.resizable()
.cornerRadius(8)
.frame(width: 300, height: 200)
if animationInProgress {
TestLottieView(animationInProgress: $animationInProgress)
.frame(width: 50, height: 50)
}
Spacer()
Button("Like this product", action: {
animationInProgress.toggle()
})
.foregroundColor(.white)
.padding()
.background(Color.accentColor)
.cornerRadius(8)
.padding(.top, 50)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Thank you very much in advance for your help