local function drawRows() table:deleteAllRows() local r2=myApp.HeightBar local aux for i=1,#rows do if(rows[i].tipo == "titulo") then aux = i local rowColor = { default={ 1, 153/255, 0 }, over={ 1, 153/255, 0 } } table:insertRow{ rowHeight=r2, isCategory=false, rowColor=rowColor } elseif(rows[i].tipo =="graficoVisual") then local rowColor = { default={ 1, 1, 1, 0.9 }, over={ 1, 1, 1, 0 } } if(rows[aux].visible) then table:insertRow{ rowHeight=180, isCategory=false, rowColor=rowColor } else table:insertRow{ rowHeight=r2 \* 0, isCategory=false, rowColor=rowColor } end elseif (rows[i].tipo =="espacio") then local rowColor = { default={ 1, 1, 1, 0.9 }, over={ 1, 1, 1, 0 } } if(rows[aux].visible) then table:insertRow{ rowHeight=r2 \* 0.2, isCategory=false, rowColor=rowColor } else table:insertRow{ rowHeight=r2 \* 0, isCategory=false, rowColor=rowColor } end else local rowColor = { default={ 1, 1, 1, 0.9 }, over={ 1, 1, 1, 0 } } if(rows[aux].visible) then table:insertRow{ rowHeight=r2 \* 0.75, isCategory=false, rowColor=rowColor } else table:insertRow{ rowHeight=r2 \* 0, isCategory=false, rowColor=rowColor } end end end end
Here is where I put all the rowColors to the rows, but when I try to put rowColor to not change, putting the same color in default and in over, the color changes to white when I click on the row but if I change over color to black the color on click change to black and I don’t understand why it doesn’t work with the same color.
Here is the problem:
http://imgur.com/a/NoUea
And here is the onRowTouch, where i don’t do anything that changes the rowColor:
local onRowTouch = function (event) local row=event.row local background=event.background local phase=event.phase local phase=event.phase -- if rowPhase=="began" then return end if phase=="release" then if rows[row.index].valor=="resumen" then rows[row.index].visible=not rows[row.index].visible drawRows() table:reloadData() end if rows[row.index].valor=="grafico" then rows[row.index].visible=not rows[row.index].visible drawRows() table:reloadData() end return true end end