Файл Lottie не выровнен должным образомIOS

Программируем под IOS
Ответить
Гость
 Файл Lottie не выровнен должным образом

Сообщение Гость »


I'm using this Lottie library to render a Lottie animation in SwiftUI.
This is my Lottie file, as you can see it is flush against the left margin (left aligned):
Изображение
Now I try to load this in my app as follows:

Код: Выделить всё

VStack(alignment: .leading, spacing: .zero) {
LottieView(animation: .named("loading-animation"))
.playing(loopMode: .loop)
.frame(height: 40)
}
As you can see here below, the Lottie animation isn't right aligned as I wish and is placed somewhere at the center.
Изображение
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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»