Hi!
I use a scrollView object wich contains a list of items I want to show as I insert them into the scrollView.
You can see in this video the delay between I start getting the items and the items are showed.
This delay is even greater in the device.
In the console you can see each time I get an item but it still is not shown in the scrollView.
The db is located into documentsDirectory, so I figured out the results must appear very fast…
[sharedmedia=core:attachments:80]
This is the code that do it.
local function myScroll(theItems) local items = theItems local i scrollViewDer.x = 320 scrollViewDer.y = 197 scrollViewDer:insert(grupoScrollDer) for i=1,#items do for each\_item in db:nrows("SELECT nombre,categoria,calle FROM hoteles WHERE id="..items[i]) do local grupoPestanaHotel = display.newGroup() local fondo\_pestana\_hotel = widget.newButton{ id = items[i], width = 704, height = 132, default = ruta\_imaxes.."fondo\_pestana\_hotel.png", onEvent = accionElixeHotel, } fondo\_pestana\_hotel:setReferencePoint(display.TopLeftReferencePoint) fondo\_pestana\_hotel.x = 0; fondo\_pestana\_hotel.y = 0 grupoPestanaHotel:insert(fondo\_pestana\_hotel) grupoPestanaHotel.x = 0 grupoPestanaHotel.y = fondo\_pestana\_hotel.height \* (i-1) grupoScrollDer:insert(grupoPestanaHotel) for each\_photo in db:nrows("SELECT foto FROM fotos WHERE tabla='hoteles' AND orden=1 AND idTabla="..items[i]) do local arq = each\_photo.foto local foto\_establecemento = display.newImageRect(tostring(id\_catalogo).."/"..arq,system.DocumentsDirectory,117,82) foto\_establecemento:setReferencePoint(display.TopLeftReferencePoint) foto\_establecemento.x = 22 foto\_establecemento.y = 26 grupoPestanaHotel:insert(foto\_establecemento) end local j,jj local num\_estrelas = tonumber(each\_item.categoria) if num\_estrelas \< 6 and que\_vexo == "hoteis" then for j=1,num\_estrelas do local estrelina = display.newImageRect(ruta\_imaxes.."ilustracion\_estrella\_x.png",35,34) estrelina:setReferencePoint(display.TopLeftReferencePoint) estrelina.xScale = 0.65 estrelina.yScale = 0.65 estrelina.x = 156 + 17\*(j-1) estrelina.y = 17 grupoPestanaHotel:insert(estrelina) end elseif num\_estrelas \> 7 and num\_estrelas \< 11 and que\_vexo == "apartamentos" then for jj=1,num\_estrelas-7 do local chavina = display.newImageRect(ruta\_imaxes.."ilustracion\_llave\_x.png",39,40) chavina:setReferencePoint(display.TopLeftReferencePoint) chavina.xScale = 0.50 chavina.yScale = 0.50 chavina.x = 156 + 20\*(jj-1) chavina.y = 17 grupoPestanaHotel:insert(chavina) end end local nome\_hotel = display.newText(each\_item.nombre,158,36,346,0,"TitilliumWeb-Bold",18) nome\_hotel:setTextColor(102,102,102) grupoPestanaHotel:insert(nome\_hotel) local enderezo\_hotel = display.newText(each\_item.calle,158,86,346,0,"TitilliumWeb-Regular",15) enderezo\_hotel:setTextColor(102,102,102) grupoPestanaHotel:insert(enderezo\_hotel) local ids = {} for fileira\_servizos in db:nrows("SELECT idIcono FROM iconosHotel WHERE idHotel="..items[i]) do table.insert(ids,fileira\_servizos.idIcono) end local linha\_separadora = display.newImageRect(ruta\_imaxes.."linea\_separadorofertas\_x.png",704,2) linha\_separadora:setReferencePoint(display.TopLeftReferencePoint) linha\_separadora.x = 0 linha\_separadora.y = 132 grupoPestanaHotel:insert(linha\_separadora) end end end