Read Gif Images using WebView android

前端 未结 4 1714
渐次进展
渐次进展 2021-01-01 08:30

When I try to read a gif images using a WebView in Android 2.3.3 API 10, it\'s not animated (it appears static). How can I solve this issue? Is there any setting I must chan

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 08:34

    To use GIF in your android code,

    Step 1: Assets folder setting : In this folder you have to place your GIF and html code. Html code is following

    
    
        
    
    
    
    
    

    In this code lets assume you have splash.gif in ur assets folder

    Step 2: Just load the webview with this url

    wvSplashScreen.loadUrl("file:///android_asset/splash.html");

    By these 2 simple step you can load GIF in your webview

提交回复
热议问题