Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi.I have a widget. and an image view in that; I want to get/set size of the ImageView programmatically; And do this for other view like relativeLayout and ..... How Can I do this ?
Thanks
Posted

Just Type This Code in main activity

image_view.getLayoutParams().width = 20;
image_view.getLayoutParams().height = 20;


I thought this will solve your problem.
 
Share this answer
 
C#
image_view.getLayoutParams().width = 20;
image_view.getLayoutParams().height = 20;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900