Hi everyone…
I have been trying to find a way to add data to my table view…
I have seen few videos and samples, and I just can not make it work.
The jay white videos, a few tutorials on Corona, on the forum I see widget 1.0
or old tutorials…
So far I have the table view with rows and text … row1, row2. row3, and so forth…
How do I add my own text?
even Jay said, that was a nightmare…
is it so difficult?
I follow the Jays video…
local top = display.statusBarHeight local listRecs = {} local nameData = {"Smith", "Williams", "Jones", "Brown", "Miller", "Smith", "Williams", "Jones", "Brown", "Miller","Smith", "Williams", "Jones", "Brown", "Miller","Smith", "Williams", "Jones", "Brown", "Miller"} local function setup() local bg = display.newRect(240, 180, display.contentWidth, display.contentHeight - top) bg:setFillColor(0, .67, .29) list = widget.newTableView { top = top + 10, height = 304 } end local function loadData() for x = 1, #nameData do listRecs[x] = {} listRecs[x].name = nameData[x] listRecs[x].age = math.random(18, 35) listRecs[x].showDel = false end end local function showRecords() local function onRowRender (event) local row = event.row local rowGroup = event.view local idx = row.index or 0 local color = 0 row.textObj = display.newText( listRecs[idx].name, 0, 0, "Helvetica", 14) row.textObj:setTextColor (color) row.textObj.anchorX = 0 row.textObj.x = 40 row.textObj.y = rowGroup.contentHeight \* 0.35 rowGroup:insert(row.textObj) end -- onRowRender local function rowListener(event) end -- rowListener for x = 1, #listRecs do list:insertRow { onRender = onRowRender, listener = rowListener } end end -- showRecords setup() loadData() showRecords()
unless I am making something wrong, but at this point in the video I see the last names
in my table … everything is empty
also he is using “mask”. I think in widget 2.0 there is no mask…
Please someone on the other side, help me with this, please…
thanks for all your time, honestly, thank you for everything
Victor