Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
创建一个 Android 库,它包括向用户显示 gif。
根据我的阅读,您使用 WebView 来显示 gif,这适用于 API 级别 8。
因此,除了显示内容(可绘制内容)之外,我已经完成了所有工作。
如何将 loadUrl 方法的 URL 获取到可绘制对象?
通常,我会使用资产,但因为这是一个库,所以我不能这样做。
将此 gif 图像放在 assets 文件夹中。您将能够像这样访问 html webview 中的资产文件夹
<img src='file:///android_asset/gif-file-name.gif\'/>