SVGA

集成指南

将播放器集成至 iOS / Android / Flutter / Web

iOS

  • 使用 CocoaPods 集成源码,将以下依赖:

  • pod 'SVGAPlayer'

  • 添加至 Podfile 文件。

  • 使用代码或 IB 添加 SVGAPlayer 至 View 中,具体方法参见:
    https://github.com/svga/SVGAPlayer-iOS

Android

  • 使用 Gradle 集成源码,添加 JitPack.io 到 root build.gradle 中

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }

  • 添加以下依赖:

    compile 'com.github.svga:SVGAPlayer-Android:2.0.0'

  • 根据需要修改版本号,要获取最新的版本请点入:
    https://jitpack.io/#svga/SVGAPlayer-Android

  • 使用代码或 XML 添加 SVGAImageView 至 View 中,具体方法参见:
    https://github.com/svga/SVGAPlayer-Android

Web