2
I tried using Layoutparams but it didn’t work, I tried layoutParams.width = 80;
and it didn’t work. Does anyone know how to do that? I thank you in advance.
In my case the picture got too big I needed to decrease.
My code:
ImageView iv = new ImageView(this);
iv.setImageDrawable(getResources().getDrawable(R.drawable.verde));
Since your image is in the folder drawable the indicated would be that it already had the desired dimensions. So it would not have to use processing and memory at runtime.
– ramaral
If however you really want to do this at runtime post the code when you tried to use
layoutParams
and explain what you mean by "it didn’t work".– ramaral