OC 项目:建议使用2.5 版本,从 GitHub 上可以看到,3.0 版本以上是swift 写的。
Swift 项目:直接使用最新版本。
通过 CocoaPods 集成:
- 在 Podfile 中添加 pod ‘lottie-ios’,’~> 2.5’
- 运行 pod install
示例代码
LOTAnimationView *animation = [LOTAnimationView animationNamed:@"Lottie"];
[self.view addSubview:animation];
[animation playWithCompletion:^(BOOL animationFinished) {
// Do Something
}];
本文详细介绍如何在OC和Swift项目中集成Lottie动画库,包括版本选择、CocoaPods集成步骤及示例代码。Lottie是一款强大的动画工具,能够将Adobe After Effects动画无缝转换为iOS和Android平台使用的格式。
2082

被折叠的 条评论
为什么被折叠?



