其實我正在使用相對佈局圖像視圖。該圖像視圖用於從互聯網接收圖像到應用程序。我需要的是我可以動態地改變圖像的大小爲一個特定的圖像(說jpeg)和另一個大小的附件(docx,pdf)等。如何在android中爲特定圖像動態更改imageview大小?
我使用的條件爲圖像和另一個如果爲附件。現在如何設置接收圖像的圖像大小和接收附件的另一圖像大小。我需要動態地做。注意我只對圖像和附件使用一個圖像視圖。
<RelativeLayout>
<ImageView>
id=iv
width=wrap content
height=wrap content
</ImageView>
</RelativeLayout>
for class file
if("image/png"){
iv.setImageResource(R.drawable.abc);
or
code to get images from web
}
else if(mimetype("application/pdf")
{
iv.setImageResource(R.drawable.abc)
}
this is the model
Help me out!
後一些代碼的人。 –