Android Question ScrollView

Declan

Well-Known Member
Licensed User
Longtime User
Been playing with the ScrollView examples.
Is there an example that will allow the loading of images 3 across by XX down?
 

Declan

Well-Known Member
Licensed User
Longtime User
I would like to display images from a folder.
I can load the images into a ScrollView vertically (in a single column) no problem.
However, what I would like to achieve, is a ScrollView that will display 3 x images across (3 columns).
For instance, if the folder contains 9 images, the images would be displayed 3 across x 3 down (3 columns X 3 rows) etc.
Almost as if displaying images in a grid.
 
Upvote 0

Declan

Well-Known Member
Licensed User
Longtime User
Thanks, but I cannot work out how to have additional "columns"
I need to have 3 images on a row with a vertical gap (vertical divider) between them.
Similarly, the rows must have a gap (horizontal divider) between them.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Thanks, but I cannot work out how to have additional "columns"
I need to have 3 images on a row with a vertical gap (vertical divider) between them.
Similarly, the rows must have a gap (horizontal divider) between them.

you dont need 3 columns you can put all 3 images in 1 column and just find the right position for each image.

like:
img(0).left = 0 & img(0).width = 33%x,
img(1).left = 33%x & img(1).width = 33%x
'...

it would be the same like having columns. you give each image a fix width (33%x, if you want 3 images in a row)
 
Upvote 0

Declan

Well-Known Member
Licensed User
Longtime User
@Mahares, @ilan,
Thanks guys, I will go with the recommendation of @Mahares.
Works well......just a problem with setting ItemHeight / Itemwidth - images are always square.
Also not getting correct filename with GridView_ItemClick(Position As Int, Value As Object)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…