I am using some code someone posted on here showing how to high lite the selected row item in a tableView. It works most of the time but sometimes when I am trying to scroll down I get the error below:
Runtime Error
widgetLibrary/widget_tableview.lua: 452: attempt to call method “setFillColor” (a nil value)
Here is the code I am using for the onRowTouch:
local function onRowTouch1( event ) local phase = event.phase local row = event.target if "press" == phase then for i = 1, list1:getNumRows() do if i == row.index then list1.\_view.\_rows[i].\_rowColor.default = { 1, 100/255, 100/255 } else list1.\_view.\_rows[i].\_rowColor.default = { 1, 1, 1 } end; end A1 = strings1[event.target.index] composer.setVariable( "Month", A1 ) list1:reloadData() end end
And the rowRender code
local function onRowRender1( event ) local phase = event.phase local row = event.row local groupContentHeight = row.contentHeight local Title = event.row.params.rowTitle local rowTitle = display.newText( row, Title, 0, 0, native.systemFont, 32) rowTitle.x = 20 rowTitle.anchorX = 0 rowTitle.anchorY = 0 rowTitle.y = 30 --rowTitle:setFillColor( 0, 0, 0 ) end