Я использую эту библиотеку Lottie для рендеринга анимации Lottie в SwiftUI.
Это мой файл Lottie, как вы можете видеть, он расположен на одном уровне с левым полем (выровнен по левому краю). :

< p>Теперь я пытаюсь загрузить это в свое приложение следующим образом:
Код: Выделить всё
VStack(alignment: .leading, spacing: .zero) {
LottieView(animation: .named("loading-animation"))
.playing(loopMode: .loop)
.frame(height: 40)
}

Not sure why the above code doesn't work as is to align the Lottie animation to the left as if I just use another view with this code (A rectangle for example,) it will be left aligned as expected.
How can I make a Lottie animation view align to the left in SwiftUI?
Источник: https://stackoverflow.com/questions/781 ... s-expected
Мобильная версия