lottie-ios icon indicating copy to clipboard operation
lottie-ios copied to clipboard

Animation playing bug in iOS SDK

Open palyvoda opened this issue 3 years ago • 8 comments

Hello. When I play the json animation file with Lottie iOS SDK, it has bugs with borders: the character's body outline(border) does not move in sync with the body. If I play animation in the web version with Lottie JSON Editor - everything looks fine. Seems like iOS SDK renders the animation differently. I attach the animation file. Is it the SDK bug or can my designer change something in the json?

Also I attach the screenshot with border problem. Thank you!

Attachments: https://fex.net/s/lcrcrtd

palyvoda avatar Nov 23 '21 11:11 palyvoda

you can preview your json use LottieFiles App in appstore. maybe you can set frame to your animationview or contentMode. your json work is good in my code.

maiyabj avatar Dec 02 '21 03:12 maiyabj

@maiyabj I did it, I tested it with Lottie app from App Store and it plays it wrong again and again On iOS side(Lottie App Store app or testing with SDK by myself) the border of the hood does not move synchronously with the character's head, but it moves synchronously if we play the animation on the website json editor.

palyvoda avatar Dec 03 '21 10:12 palyvoda

@maiyabj is the problem in iOS SDK?

palyvoda avatar Dec 06 '21 10:12 palyvoda

Simulator Screen Shot - iPhone 8 - 2021-12-07 at 17 47 59

in my simulator is ok this is my code:

 let loadingImageView = AnimationView().then {
        $0.animation = Animation.filepath(R.file.animationFileIOSSDKPlaysItWrong1Json.path()!)
        $0.loopMode = .loop
        $0.contentMode = .scaleAspectFit
        $0.backgroundBehavior = .pauseAndRestore
    }
view.addSubview(loadingImageView)
        loadingImageView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(200)
        }

maiyabj avatar Dec 07 '21 09:12 maiyabj

@maiyabj is the problem in iOS SDK?

https://user-images.githubusercontent.com/13246625/145006756-713403da-4e99-4ca2-917a-7d841b177aac.mp4

you can set const to width or height
loadingImageView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(200)
            make.width.equalTo(100)
            make.height.equalTo(160)
        }

https://user-images.githubusercontent.com/13246625/145006929-36caefa3-8b94-417b-af2a-ea6ee6a10d56.mp4

maiyabj avatar Dec 07 '21 09:12 maiyabj

@maiyab Please, look at the border... It must not look like this. If you will play this json on Lottie json editor on website - you'll see the difference behind border behaviour. Screenshot 2021-12-07 at 11 54 08 j

palyvoda avatar Dec 07 '21 09:12 palyvoda

@maiyaB Please, look at the border... It must not look like this. If you will play this json on Lottie json editor on website - you'll see the difference behind border behaviour. Screenshot 2021-12-07 at 11 54 08 j

please show me your code

maiyabj avatar Dec 07 '21 09:12 maiyabj

@maiyabj I tried your code that you provided, result is the same

palyvoda avatar Dec 10 '21 12:12 palyvoda

@palyvoda, could you share a copy of your animation json? The link you originally shared no longer works

calda avatar Aug 04 '22 00:08 calda

This issue is stale because it is marked "can't reproduce" and has had no activity in the past week. Please comment with additional information, or this issue will be closed due to inactivity in one week.

github-actions[bot] avatar Aug 11 '22 01:08 github-actions[bot]

I have the same issue

AlaaElrhmanArafa avatar Mar 13 '23 07:03 AlaaElrhmanArafa