Gif not animated in custom listview

前端 未结 5 592
南方客
南方客 2021-02-02 03:51

\"enter

I want to display animated GIF images in my custom listview.my GIF image is get in

5条回答
  •  遇见更好的自我
    2021-02-02 04:45

    //-----------------GIF Image view ------------
    
    holder.imgAdd.getSettings().setJavaScriptEnabled(true);
    
    holder.imgAdd.setWebChromeClient(new WebChromeClient() {
        public void onProgressChanged(WebView view, int progress)
        {
            activity.setTitle("Loading...");
            activity.setProgress(progress * 100);
    
            if(progress == 100)
                activity.setTitle(R.string.app_name);
        }
    });
    
    holder.imgAdd.setWebViewClient(new WebViewClient() {
        @Override
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
        {
            // Handle the error
        }
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url)
        {
            view.loadUrl(url);
            return true;
        }
    });
    
                holder.imgAdd.loadUrl(imgUrl);
    

提交回复
热议问题