Hi Brent, thanks for replying.
This is my initial TableView code that I call (I have it tucked away in a function file): -
local function CreateListView(lLeft,lTop,lWidth, lHeight, onRenderFunction, onRowFunction)
local list = widget.newTableView { left = lLeft, top = lTop, width =lWidth, height = lHeight, isBounceEnabled = false, onRowRender = onRenderFunction, onRowTouch = onRowFunction, } return list end
Then I call another function which loads the table view: -
DisplayList:insertRow { isCategory=true, rowHeight =45, lineColor={212,212, 212}, rowColor = { default = { 57,100,152 }, }, } for i = 1, #results do if results[i].type == ListType then DisplayList:insertRow { rowHeight = 35, lineColor={212,212, 212}, rowColor = { default = { 255,255, 255 }, }, params = { rowid = i }, } end end
Then I use the following row render function: -
local listViewRowRender = function( event ) local row = event.row local id = row.index local params = event.row.params local title={} if id == 1 then if GlobListType == "SignInStatus" then title[1] = "Staff Working Today" title[2] = "Status" end if GlobListType == "AllocationIssues" then title[1] = "Allocation Date/Shift" title[2] = "Area / Detail" end if GlobListType == "ResidentTasks" then title[1] = "Area" title[2] = "Resident" end if GlobListType == "Other Tasks" then title[1] = "Type" title[2] = "Description" end local taskDetail = display.newText( row, title[1], 0, 0, "Calibri", 18 ) taskDetail.x = row.x - ( row.contentWidth \* 0.5 ) + ( taskDetail.contentWidth \* 0.5 ) + 10 taskDetail.y = row.contentHeight \* 0.5 taskDetail:setTextColor(255, 255, 255) local taskDetail2 = display.newText( row, title[2], 0, 0, "Calibri", 18 ) taskDetail2.x = 220 + (taskDetail2.contentWidth / 2) taskDetail2.y = row.contentHeight \* 0.5 taskDetail2:setTextColor(255, 255, 255) end if (event.row.params) then if id ~= 1 then print("Param" .. params.rowid) local rowid = params.rowid local taskDetail = display.newText( row, results[rowid].title, 0, 0, "Calibri", 16 ) taskDetail.x = row.x - ( row.contentWidth \* 0.5 ) + ( taskDetail.contentWidth \* 0.5 ) + 10 taskDetail.y = row.contentHeight \* 0.5 taskDetail:setTextColor(61, 61, 61) local taskDetail2 = display.newText( row, results[rowid].detail, 0, 0, "Calibri", 16 ) taskDetail2.x = 220 + (taskDetail2.contentWidth / 2) taskDetail2.y = row.contentHeight \* 0.5 taskDetail2:setTextColor(61, 61, 61) if results[rowid].status == "2" then local taskStatus = display.newImage( row, "ongoingIcon.png", false ) taskStatus.x = row.x + ( row.contentWidth \* 0.5 ) - taskStatus.contentWidth taskStatus.y = row.contentHeight \* 0.5 else local taskStatus = display.newImage( row, "overdueIcon.png", false ) taskStatus.x = row.x + ( row.contentWidth \* 0.5 ) - taskStatus.contentWidth taskStatus.y = row.contentHeight \* 0.5 end end end return true end
My issue is that the tableview container is not the same size as the screen (this is an IPAD App). The initial load is great, but then when I scroll the table view “bleeds” beyond the size of the initial container by about 3 rows. I have fixed it by having a blank box positioned on top of the table view which is higher than the table view in the z hierarchy. This stops the user seeing the “bleeding”, but it is frustrating.
Not sure how I tell you which build I am on…