Can someone please provide a code to display GIF images in a webview ( I'm already able to display the same using frame animation of png images) Now I want a way to display the GIF images rather than loading the frames or drawing the images again and again!
Animated images in HTML are an image on a web page that moves. It is in GIF format i.e. Graphics Interchange Format file. To add an animated image in HTML is quite easy. You need to use the <image> tag with the src attribute.
Graphics Interchange Format(GIF) pictures play a huge part in little picture movement. Actually Android doesn't provide any support for GIF animation in the image view, but displaying a GIF image in an android application is not an exhausting process.
Loads gif in a webview and fits it to the device screen without any HTML code...Try this code
mWebView = ((CustomWebView)mRootView.findViewById(R.id.webview));
mWebView.loadUrl("file:///android_asset/file.gif");
mWebView.getSettings().setLoadWithOverviewMode(true);
mWebView.getSettings().setUseWideViewPort(true);
You do not need any HTML code... Just use this line
webViewControl.LoadUrl("file://" + pathToTheGifFile);
It Works for Me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With