Hi
I’m having an error that i cant figure out.
Im adding images to a tableview. Those images are captures that i create outside of the table view and then insert then on the table rows.
the error im receiving is in the Capturar.PNG file. it says: 105: bad argument #-2 to ‘insert’ got nil.
The problem is that the table is already created and this error only shows when im scrooling throught it. and there is nothing on my onRowTouch that calls the function onRowRender again. There is no reason for it to try to insert it again is there? If there is why it gives an error? i havent removed the captures (is it a problem with captures?).
ill try to send the parts of my code that are being used. never did it.
function menuLateral.onRowRender( event)
local phase = event.phase
local row = event.row
local groupContentHeight = row.contentHeight
local groupContentWidth = row.contentWidth
row.TitRetangulo1 = display.newRect(row,0,0,65,16+2)
row.TitRetangulo1:setFillColor(0,0,0)
row.TitRetangulo1.anchorX=0;row.TitRetangulo1.anchorY=0
row.TitRetangulo1.x = 0
row.TitRetangulo1.y = 0
row.params.imagem
row:insert(row.params.imagem) – THIS LINE AN ERROR
row.params.imagem.x = 0
row.params.imagem.y = row.TitRetangulo1.y + row.TitRetangulo1.height
row.rowTitle = display.newText( row, row.params.texto,0,0, 65, 0, “Arquivos/fontes/arial.ttf”, 15 )
row.rowTitle.x = 2
row.rowTitle.anchorX = 0;row.rowTitle.anchorY = 0
row.rowTitle.y = 0
row.rowTitle:setFillColor( 1,1,1 )
end
[lua]
Now the code that call the rowRender function:
[/lua]
for i = 1,#menuLateralTelas do
Telas[menuLateralTelas.tipo].TXTs.vetorTelas[i].capture:scale(menuLateral.escala,menuLateral.escala)
local rowHeight = Telas[menuLateralTelas.tipo].TXTs.vetorTelas[i].capture.height*menuLateral.escala
local rowColor = {
default = tableViewColors.rowColor.default,
over = tableViewColors.rowColor.over,
}
menuLateral.tableView:insertRow{
rowHeight = rowHeight,
rowColor = rowColor,
lineColor = tableViewColors.lineColor,
params = {
defaultLabelColor=tableViewColors.defaultLabelColor,
catLabelColor=tableViewColors.catLabelColor,
texto = menuLateralTelas[i],
imagem = Telas[menuLateralTelas.tipo].TXTs.vetorTelas[i].capture
}
}
end
i uploaded a video showing the error ocurring. Here is the link:
https://drive.google.com/open?id=1G_ae3T48VpHDuddn_loLfUbX-wLlznMB
Thanks in advance
My best Regards