Lottie-ios: Timeline for supporting dynamic text

Created on 11 Jun 2019  路  8Comments  路  Source: airbnb/lottie-ios

Is there a timeline for implementing support for dynamically changing text?

Most helpful comment

Post some code on how to change text dynamically. Been trying this for 2 days. Really hard to figure it.

All 8 comments

It has been added in the latest version. Cheers!

Could you point me to some documentation or somewhere in the code where I can see how to use it.

Theres no documentation yet, but the PR that added the support is here
https://github.com/airbnb/lottie-ios/pull/938

>

Post some code on how to change text dynamically. Been trying this for 2 days. Really hard to figure it.

It would be great help if you could post some example. I am using DictionaryTextProvider but no luck:
animationView.textProvider = DictionaryTextProvider(["**.Amount": "10 kr."])

@khawajafarooq A little late but I've had the same issue. Turns out you need to set the textProvider BEFORE setting the animation into your animationView. Works fine when you do it that way.

        let textProvider = DictionaryTextProvider(["Type": "HOWDY COWBOY"])
        lottieView.textProvider = textProvider
        lottieView.animation = yourAnimation

@Heidan34 thanks for sharing. Mine was fixing in the Lottie file.

@Heidan34 thanks for sharing. Mine was fixing in the Lottie file.

what was the issue in the Lottie file ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisballinger picture chrisballinger  路  4Comments

Ushaka picture Ushaka  路  5Comments

zhangjunmax picture zhangjunmax  路  3Comments

webdale picture webdale  路  5Comments

loganblevins picture loganblevins  路  3Comments