Android Question ImageView same size to panel


Active Member
Licensed User
Longtime User
Hello , i want to put a bitmap in a ImageView to a panel . The bitmap is smaller than the available resolutions.
How to make the ImageView dimensions equal to panel without Designer , just with code . The bitmap will be stretched and fit then all the panel?

Thanks Enthousiastyic


Licensed User
Longtime User
Assuming imageview1 is already a child to panel1:
Imageview. Setlayout (0,0,panel1 .width,panel1.height )

And if you want the image to adjust itself to the image view size set it's gravity to fill
Upvote 0