![](/img/trans.png)
[英]I want to to get multiple images from the url and have to use them in my image view
[英]i have this XML and i want to get image from this Image View against id
我有这个XML,我想从ID的detail_prfImagView的此图像视图中获取图像并将其保存到变量中。
<ImageView
android:id="@+id/detail_prfImagView"
android:layout_width="100dp"
android:layout_height="100dp" />
调用setViewContent
之后,需要在活动中执行此setViewContent
:
ImageView imageView = (ImgaeView) findViewById(R.id.detail_prfImagView);
要检索与ImageView
关联的位图,可以使用getDrawable
ImageView imageView = (ImgaeView) findViewById(R.id.detail_prfImagView);
Bitmap bitmap = null;
if (imageView.getDrawable() instanceof BitmapDrawable) {
bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.