Question Detail

How to set imageview height and width programmatically android


Thread Reply

Hemant Sharma

- 8 months ago

You have to call RequestLayout which is denai default set Height by XML file image_view.requestLayout();

this is the Simple way to set the height of the ImageView:

image_view.getLayoutParams().height =50;

Same with Width : 

image_view.getLayoutParams().width =50;