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

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

Сообщение Anonymous »


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 in SwiftUI 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 ... in-swiftui
Ответить

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

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

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

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

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