Thank you for the reply. I will try - display 10 items and pre load images then add lazy loading …
I’ve seen lots of iphone app which has tons of images in a table and it loads smoothly… all images has preloader and they look professional. Is this a Corona limitation.
Here is code -
function displayData(id) myList=json.decode(loadValue(id..'.txt')); for key,value in pairs(myList.data) do --local isCategory = false local rowHeight = 250 -- local rowColor = { tableView:insertRow { rowHeight = rowHeight, isCategory = false, rowColor = { 1, 1, 1 }, lineColor = { 0.90, 0.90, 0.90 }, params = { title = myList.data[key].title, price = myList.data[key].price, price2 = myList.data[key].price2, desc = myList.data[key].sdesc, img = myList.data[key].img, imgfile = myList.data[key].imgfile, thumb = myList.data[key].thumb } } end end local function onRowRender( event ) local phase = event.phase local row = event.row local params = event.row.params local filename = params.imgfile local function thumbListener( event ) if ( event.isError ) then else event.target.alpha = 0 -- -- This is scaling code. I have no idea how big the downloaded image was. -- Divide the desired height of the image by the real height and that gives us a number we -- can feed to the scale() method to keep the image's aspect ratio and controlling the height. -- If you need to furhter control the width, you could do a second pass kind of like this: -- -- if w \* s \> maxWidth then s = maxWidth / w end -- -- and feed the new s value to the scale() method. -- local w = event.target.width --print(w..display.contentWidth) local h = event.target.height local s = 100 / h local offset=0 if w \> display.contentWidth then local diff = w-display.contentWidth; offset = math.abs(display.contentWidth-diff/2); print(w..display.contentWidth..offset) else offset = display.contentWidth-w end event.target:scale(s,s) event.target.anchorX = 0 event.target.anchorY = 0 event.target.x =0 event.target.y = 0 -- -- put the image into the row -- row:insert(event.target) event.target.alpha=1 --transition.to( event.target, {time=100, alpha = 1.0 } ) end end -- downloadFile(params.thumb,completionListener) local groupContentHeight = row.contentHeight if params.img then display.loadRemoteImage(params.img, "GET", thumbListener, filename, system.CachesDirectory, 0, 0 ) end if params.price then local rowPrice = display.newText( row, params.price, 0, 0,240, 0, myApp.font,18) rowPrice.x = display.contentWidth-60 rowPrice.anchorX = 0 rowPrice.y =groupContentHeight \* 0.85 rowPrice:setFillColor(0,0,0) if params.price2 then local rowPrice2 = display.newText( row, params.price2, 0, 0,240, 0, myApp.font,14) rowPrice2.x = display.contentWidth-60 rowPrice2.anchorX = 0 rowPrice2.y =groupContentHeight \* 0.91 rowPrice2:setFillColor(0,0,0) end local rowTitle = display.newText( row, params.title, 0, 0,240, 0, myApp.font,15) rowTitle.x = 10 rowTitle.anchorX = 0 rowTitle.y =groupContentHeight \* 0.9 rowTitle:setFillColor(0,0,0) end end