![](/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.