Hello!
[x] The issue doesn't involve an Unsupported Feature
[x] This issue isn't related to another open issue
Lottie 3.0
[ ] MacOS
[x] iOS
CompatibleAnimationView should be the same size as the parent view
CompatibleAnimationView is not the same size as the parent view

(void)viewDidLoad
{
[super viewDidLoad];
CGFloat timeLineViewW = 276.f;
CGFloat timeLineViewH = 96.f;
CGFloat timeLineViewX = (self.view.bounds.size.width - timeLineViewW) / 2.f;
CGFloat timeLineViewY = (self.view.bounds.size.width - timeLineViewH) / 2.f;
UIView *timeLineView = [[UIView alloc] initWithFrame:CGRectMake(timeLineViewX, timeLineViewY, timeLineViewW, timeLineViewH)];
timeLineView.backgroundColor = [UIColor blueColor];
[self.view addSubview:timeLineView];
CompatibleAnimationView *animationView = [[CompatibleAnimationView alloc] initWithFrame:timeLineView.bounds];
animationView.contentMode = UIViewContentModeScaleAspectFit;
animationView.loopAnimationCount = -1;
animationView.compatibleAnimation = [[CompatibleAnimation alloc] initWithName:@"timeline" bundle:[NSBundle mainBundle]];
[animationView play];
[timeLineView addSubview:animationView];
}
I am facing the same issue. I suppose it comes from the constraints but i have to test
@whisterlee actually found a fix! set translatesAutoresizingMaskIntoConstraints to true on the CompatibleAnimationView
@farfromrefug Thank you so much, you just saved me!
But I want to clarify, you need to fix this line:
https://github.com/airbnb/lottie-ios/blob/934954c378fbd49f3798931cd314740ff3176972/lottie-swift/src/Public/iOS/Compatibility/CompatibleAnimationView.swift#L296
not in setUpViews()
Most helpful comment
@whisterlee actually found a fix! set
translatesAutoresizingMaskIntoConstraintstotrueon theCompatibleAnimationView