如何在 android 中使用 setImageURI()?
How to use setImageURI() in android?
我试过了
imageView=(ImageView)view.findViewById(R.id.imageView);
Uri photoUrl = profile1.getPhotoUrl();
imageView.setImageURI(photoUrl);
但是我什么也没看到。
我在打印时收到 url
提前致谢
为此尝试使用 picasso
:
Picasso.with(context)
.load(url)
.placeholder(R.drawable.placeholder)
.resize(imgWidth, imgHeight)
.centerCrop()
.into(image);
试试这个
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("YOUR_URL").getContent());
imageView.setImageBitmap(bitmap);
我试过了
imageView=(ImageView)view.findViewById(R.id.imageView);
Uri photoUrl = profile1.getPhotoUrl();
imageView.setImageURI(photoUrl);
但是我什么也没看到。 我在打印时收到 url 提前致谢
为此尝试使用 picasso
:
Picasso.with(context)
.load(url)
.placeholder(R.drawable.placeholder)
.resize(imgWidth, imgHeight)
.centerCrop()
.into(image);
试试这个
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("YOUR_URL").getContent());
imageView.setImageBitmap(bitmap);