Giter VIP home page Giter VIP logo

Comments (10)

pfaucon avatar pfaucon commented on July 24, 2024

Have you tried with the no extra layouts?

I'm not an expert by any means, but when I added the view on my app it was compressed like that, not because it wasn't playing, but it was losing a constraint fight somewhere.

from lottiexamarin.

LeoJHarris avatar LeoJHarris commented on July 24, 2024

Yup i had moved it out so it wasnt as nested in other views and i could see the animation view in ios so there was no problem. But there is a problem that it does get compressed when nested in more or certain views situations.

Unfortunately the code snippet above was just to prove the point, in my code where i have the animation i dont have the fortune that i can move the animation view out. This should or one would expect to work regardless of how nested.

from lottiexamarin.

pfaucon avatar pfaucon commented on July 24, 2024

but can you place it inside of a view that has an enforced size? Maybe you are having problems with the nested stack layouts (both of which are vertical it looks like) ?

Maybe you can use an absolute/relative layout so that the parent view has a specified size even if the child (LottieView) doesn't know how big it should be?

from lottiexamarin.

OpticNectar avatar OpticNectar commented on July 24, 2024

I'm having this same issue. On certain pages it just doesn't show up. It seems if you have it nested within more than 2-3 layouts it doesn't show up. I tried giving it an exact size too and it didn't work either. I can see a background color if I add one though which is weird.

Also, there seems to be issue with tab pages too. Doesn't seem to want to work on any tab, but the first one.

from lottiexamarin.

vincentcastagna avatar vincentcastagna commented on July 24, 2024

Hello,

I'm having this behavior too only on iOS. For what I've seen it seems that it does not show in a particular flow.

For example, I got a loading lottie file playing when calling a rest service, and sometimes the lottie file does not show on iOS after being already played (but the layout is never changing at all, so its not the cause). Seems that showing the lottie file multiple times after showing one is causing the lottie animation not to be shown/played.

I think this is related to #132

from lottiexamarin.

vincentcastagna avatar vincentcastagna commented on July 24, 2024

Hello all,
No news about that ?

from lottiexamarin.

LeoJHarris avatar LeoJHarris commented on July 24, 2024

Not from me sorry.

from lottiexamarin.

vincentcastagna avatar vincentcastagna commented on July 24, 2024

You still have this behavior ?

My usage is quite simple, w/o nested layout in a single Rg.Plugin.PopUpPage, or something complex, still the lottie animation shows only a few times. I also have this prob on simple content pages, so I don't think this is happening because of the previous written package :

 public LoadingPage(string textLoading)
        {
            var activityIndicator = new AnimationView
            {
                Animation = "loader.json",
                Loop = true,
                AutoPlay = true,
                WidthRequest = 120,
                HeightRequest = 120
            };

            var mainLayout = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand
            };

            var labelLoading = new MR.Gestures.Label
            {
                TextColor = Color.Orange,
                Text = textLoading,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment = TextAlignment.Center
            };

            mainLayout.Children.Add(activityIndicator);
            mainLayout.Children.Add(labelLoading);
            CloseWhenBackgroundIsClicked = false;

            Content = mainLayout;
        }

from lottiexamarin.

vincentcastagna avatar vincentcastagna commented on July 24, 2024

@LeoJHarris

I found out that setting autoplay to false on iOS and calling Play() method in the OnAppearing method of the page does fix the prob

from lottiexamarin.

LeoJHarris avatar LeoJHarris commented on July 24, 2024

@Umar3x Haven't tested that yet, did you simplify the layout for the above working solution?

from lottiexamarin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.