-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lottie animation not visible on Page from ServiceProvider #147
Comments
Is there any progress of this bug? |
bump @mattleibow |
Any workaround anyone? |
Sadly, moved back to |
any update? @PureWeen Any alternative solution? @jfversluis |
bump @mattleibow |
@mattleibow is lottie still supported in maui? it does not work in ios at all |
I originally started this issue, so I'll include a possible workaround: Copy these listed resources and paste them into your app. Rendering should start working |
Ok but is there an explanation as to why this would work? PS Im yet to try the solution myself |
@MarMarIV copy to any resource dictionary at startup ? |
I had a look at this and I think I see what is happening. The lottie view uses some styles that are in the class library. Typically if you add the control to a page that is not from the services, the view will register the styles it needs before it is constructed, so it can access them. However, if the page comes from the services as in this issue, then the page and the lottie view is constructed before the app has completed construction - because it is part of the construction. A workaround is to include the themes and styles yourself in your <?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiLottieApp"
xmlns:themes="clr-namespace:SkiaSharp.Extended.UI.Controls.Themes;assembly=SkiaSharp.Extended.UI"
x:Class="MauiLottieApp.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- ... existing styles ... -->
<themes:SKLottieViewResources /> <!-- this is the new style from the library -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application> This is actually a manifestation of dotnet/maui#9612. I have to try and find a good place to add the themes, but it is not great. |
I think I have a workaround for now. I can detect when the Window changes and at that point the app is ready and the control is not yet styled. If I register my themes then it works again. |
woowhooo! 🎉 @mattleibow thanks a lot for your hard work! Does |
Description
When Page with Lottie animation is created from ServiceProvider, then Lottie animation is not visible
Steps to Reproduce
In file
App.xaml.cs
there are two examples. One i working fine. Second notLink to public reproduction project repository
https://github.com/MarMarIV/MauiLottieApp
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows
Affected platform versions
Any version
Did you find any workaround?
Unfortunately, no
Relevant log output
No response
The text was updated successfully, but these errors were encountered: