I am trying to use a tableview widget, but I can’t get any text to display inside my table. Here is some sample code. It should be displaying a 40-row table with the word “test” in each row, but not text displays. What am I doing wrong?
local widget = require(“widget”)
local sqlite3 = require( “sqlite3” )
local browsetable = widget.newTableView(
{
left = display.contentWidth*.05,
top = display.contentHeight*.15,
height = display.contentHeight*.8,
width = display.contentWidth*.9,
onRowRender = renderRow,
}
)
for i = 1, 40 do
browsetable:insertRow(
{
rowHeight = 35,
}
)
end
local function renderRow ( event )
local row = event.row
local rowHeight = row.contentHeight
local rowWidth = row.contentWidth
local rowTitle = display.newText( row, “test”, rowWidth*.5, rowHeight*.5, native.systemFont, 14 )
rowTitle:setFillColor( 0, 0, 1 )
end