First you have to decide if you want a different display on the tablets vs. the phones. If you have experience with both, you will note that on the phone, you get a tightly packed 4 wide grid of square center cropped thumbnails. The iPad shows a spread out 5 wide grid of uncropped photos.
Once you decide on your presentation, I would use a scrollView as opposed to a tableView, add each image into a table/array loop over the table inserting each photo into the scrollView. Once you pass X number of images, increment the Y value to the next row of images.
yOffset = 0
maxX = 64
maxY = 64
imageFilenames = {"image1.png", "Image2.jpg", etc.}
images = {}
for i = 1, #imageFilenames do
images[i] = display.newImage(imageFilenames[i])
local scale = maxY / images[i].height
if images[i].width \* scale \> maxX then
scale = maxX / images[i].width
}
images[i]:scale(scale,scale)
images[i]:setReferencePoint(display.TopLeftReferencePoint)
images[i].x = (i - 1) \* maxX
images[i].y = yOffset
if ((i-1) % 4) = 0) then
yOffset = yOffset + 64
end
scrollView:insert(images[i])
end
Or something like that. Now the above maintains the images aspect ratio and does not crop, does a 4 wide grid with ZERO padding or framing of the images between each other. And I don’t know if I’m inserting it properly into a scrollView. I’m just guessing at the syntax (treating it like a display group). [import]uid: 19626 topic_id: 29218 reply_id: 117535[/import]