Android Question ImageView same size to panel

Enthousiastic

Active Member
Licensed 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
 

Cableguy

Expert
Licensed User
Assuming imageview1 is already a child to panel1:
B4X:
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
 
Top