Hi Brent, if i could, i need to know another thing. I can’t find in the Api’s the “onRowRender” thing, but seems that te rows are rendered everytime i scroll (i have an image on everyone 7kb that i download dinamically by requesting an url i retrive by json), is that true?
Thanks,
Andrea.
local function onRowRender( event ) local phase = event.phase local row = event.row local function downloadFoto( event ) if ( event.isError ) then print ( "Network error - download failed" ) else listelements['testa'..row.index] = display.newImage(row,row.index..".jpg",system.TemporaryDirectory) listelements['testa'..row.index].height = 70 listelements['testa'..row.index].width = 50 listelements['testa'..row.index].x = 40 listelements['testa'..row.index].y = 50 listelements['cornice'..row.index] = display.newImageRect(row,"cornice.png",70,81) listelements['cornice'..row.index].x=40 listelements['cornice'..row.index].y=50 end --img.y = math.floor(img.height\*0.5) end network.download(pagelle[row.index].urlf, "GET", downloadFoto,row.index..".jpg", system.TemporaryDirectory) listelements['nome'..row.index] = display.newText(row,pagelle[row.index].nome,0,0,"HelveticaNeue-UltraLight",30) listelements['nome'..row.index]:setTextColor( 0, 0, 0 ) listelements['nome'..row.index].x = row.contentWidth/2 listelements['nome'..row.index].y = row.contentHeight/2 listelements['voto'..row.index] = display.newText( row,pagelle[row.index].media, 0, 0, "HelveticaNeue-UltraLight", 35 ) listelements['voto'..row.index].x = row.contentWidth - 50 listelements['voto'..row.index].y = row.contentHeight \* 0.5 local media = tonumber(pagelle[row.index].media) if pagelle[row.index].media \< "6" then listelements['voto'..row.index]:setTextColor( 255, 0, 0 ) else listelements['voto'..row.index]:setTextColor( 0, 255, 0 ) end if pagelle[row.index].gialli \> "0" then listelements['cartellino1'..row.index]=display.newImageRect(row,"giallo.png",8,11) else listelements['cartellino1'..row.index]=display.newImageRect(row,"grigio.png",8,11) end listelements['cartellino1'..row.index].x=130 listelements['cartellino1'..row.index].y=80 if pagelle[row.index].gialli == "2" then listelements['cartellino2'..row.index]=display.newImageRect(row,"giallo.png",8,11) else listelements['cartellino2'..row.index]=display.newImageRect(row,"grigio.png",8,11) end listelements['cartellino2'..row.index].x=150 listelements['cartellino2'..row.index].y=80 if pagelle[row.index].rosso == "1" then listelements['cartellino3'..row.index]=display.newImageRect(row,"rosso.png",8,11) else listelements['cartellino3'..row.index]=display.newImageRect(row,"grigio.png",8,11) end listelements['cartellino3'..row.index].x=170 listelements['cartellino3'..row.index].y=80 if pagelle[row.index].gol \> "0" then listelements['pallone'..row.index]=display.newImageRect(row,"pallone.png",11,11) listelements['pallonetext'..row.index]=display.newText( row,"x"..pagelle[row.index].gol, 0, 0, "HelveticaNeue-UltraLight", 10 ) listelements['pallonetext'..row.index]:setTextColor(0, 0, 0 ) listelements['pallonetext'..row.index].x=203 listelements['pallonetext'..row.index].y=80 else listelements['pallone'..row.index]=display.newImageRect(row,"pallonegrigio.png",8,11) end listelements['pallone'..row.index].x=190 listelements['pallone'..row.index].y=80 end