其实我正在使用相对布局图像视图。该图像视图用于从互联网接收图像到应用程序。我需要的是我可以动态地改变图像的大小为一个特定的图像(说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!
后一些代码的人。 –