【发布时间】:2014-08-07 08:20:34
【问题描述】:
我正在尝试从 assets 文件夹中加载 gif 图像。我正在关注以下链接
http://droid-blog.net/2011/10/14/tutorial-how-to-use-animated-gifs-in-android-part-3/
现在这里的问题是我的 gif 很大,所以只有一部分图像显示在视图中.. 因此我想
i want to display the gif in an xml file that has a webview as a child..
为了达到上述目的,我做了以下
setContentView(R.layout.activity_splash_about);
WebView webView = (WebView) findViewById(R.id.webView1);
GifWebView view = new GifWebView(this, "file:///android_asset/ab.gif");
webView.addView(view);
但出现以下错误
Unable to open asset URL: file:///android_asset/ab.gif
I/chromium(1139): [INFO:CONSOLE(12)] "Not allowed to load local resource:
file:///android_asset/webkit/android-weberror.png",
source: data:text/html,chromewebdata (12)
那么如何在 xml 中的 webview 中显示视图??
【问题讨论】: