Comments (5)
I identified the same problem here as well. With dotLottie files only. JSON files are working fine.
Even If I set the loopMode on the view right after building it I can observe:
- If I set the
loopMode
before setting up theanimationLoaded
block, the.loop
mode is ignored. - As indicated by @SaladDays831, If I set the
loopMode = .loop
inside theanimationLoaded
, right before the play(), it works. The animation loops.
from lottie-ios.
Can you share the animation file itself here? I can't open the lottiefile.com link:
from lottie-ios.
Oh, sorry @calda, thought it was a public animation
from lottie-ios.
I believe this is the expected behavior of a dotLottie animation, since the json manifest includes configuration on the loop mode to use, which we apply to the LottieAnimationView
when loading the animation.
@mime29's solution is a good suggestion -- if you modify the loopMode
in animationLoaded
, that will override whatever was specified by the DotLottie animation.
We've improved this in the SwiftUI LottieView by not applying the dotLottie loop mode by default, and instead making that behavior opt-in: #2277.
from lottie-ios.
I believe this is the expected behavior of a dotLottie animation, since the json manifest includes configuration on the loop mode to use, which we apply to the
LottieAnimationView
when loading the animation.@mime29's solution is a good suggestion -- if you modify the
loopMode
inanimationLoaded
, that will override whatever was specified by the DotLottie animation.We've improved this in the SwiftUI LottieView by not applying the dotLottie loop mode by default, and instead making that behavior opt-in: #2277.
@calda , I guess you meant: "since the dotLottie manifest includes configuration on the loop mode to use" ?
Is there a link to this spec? I could not find it but I'd like to forward this info to designers so that they understand better the control they have over the animation.
from lottie-ios.
Related Issues (20)
- Modifying state during view update, this will cause undefined behavior.
- `PrivacyInfo.xcprivacy` is not included in `lottie-spm` repo HOT 4
- Warning in Xcode when using Lottie 4.4.0 with cocoa pods HOT 1
- LottieAnimationView layout stuck in infinite loop HOT 5
- Completion Closure Not Called in CA Mode Like in Main Thread Mode HOT 1
- LottieView.animationDidFinish not called correctly when background behavior is set to continue playing
- Lottie missing elements in Animation HOT 3
- SPM fails to compile when lottie-spm is added via SPM Package.swift file HOT 1
- module map 'xxx/lottie-ios/Lottie.modulemap' not found HOT 2
- can't clone Lottie iOS on cocoa pods HOT 2
- lottie-spm fails builds in GitHub Actions
- Lottie animation freezes whole app on 4.4.0/4.4.1 (works fine on 4.3.1) HOT 1
- Lottie animation freezes whole app on 4.4.0/4.4.1 (works fine on 4.3.1) HOT 5
- Password with a space is being used while joining the network using airbnb app
- Troubleshooting Lottie Integration Errors in GitHub Actions CI/CD Pipeline HOT 2
- The signature of “Lottie.xcframework” cannot be validated and may have been compromised. HOT 4
- SPM: skipping cache due to an error HOT 1
- CFBundleShortString does not reflect the Lottie version HOT 3
- iOS17 privacy Policy
- Doesn't work well in SwiftUI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lottie-ios.