我想从网页或网址加载图片,例如:` “https://images.detik.com/community/media/visual/2017/11/03/5e88c080-0570-47ca-8ea9-96209df2071d_169.jpeg?w=620”
但它也无法打开或加载。
需要什么代码才能使其工作,请帮忙,谢谢。
这是我的代码
WebView wv = (WebView) findViewById(R.id.webView1);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setJavaScriptEnabled(true);
img= (ImageView) findViewById(R.id.mainbackdrop);
//BIND
nameTxt.setText(name);
propTxt.setText(propellant);
wv.loadData(desc, "text/html","UTF-8");
PicassoClient.downloadImage(this,imageurl,img);
最佳答案
Picasso
加载图像然后尝试这个
Picasso.with(activity)
.load(path)
.placeholder(R.drawable.thumbnail_placeholder)
.resize(width,height)
.into(imageView);
Webview
加载图像然后试试这个我的 friend
wv.getSettings().setUseWideViewPort(true);
wv.getSettings().setDomStorageEnabled(true);
关于java - 如何将网页上的图片加载到webview中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47090245/