Hello!
I’ve created a widget.newTableView and inserted rows into the table view. Each row has a touch event listener attached to it that when touched, whisks the user to another scene. This part works great.
What doesn’t work so great is if I have 50 items in my table, I expect my user to scroll up/down to see more rows. However, when the user tries to scroll, a touch event is registered and the user is taken to another scene.
Is there a way with table views to delay touches?
p.s. I truncated the code down to the relevant parts. If something is broken, my apologies.
local function onRowRender( event ) --Set up the localized variables to be passed via the event table local row = event.row local id = row.index row.bg = display.newRect( 0, 0, display.contentWidth, M.rowheight ) row.bg.anchorX = 0 row.bg.anchorY = 0 row.bg:setFillColor( 1, 1, 1 ) row.bg.name = "rowName" row.bg:addEventListener("touch", onCategoryNameTouch) row:insert( row.bg ) row.nameText = display.newText( "mytext", 12, 0, \_FONT, 42 ) row.nameText.anchorX = 0 row.nameText.anchorY = 0.5 row.nameText:setFillColor( 0 ) row.nameText.y = row.height \* 0.5 row.nameText.x = 42 row:insert( row.nameText ) return true end myList = widget.newTableView { top = \_S.top + 100, width = display.contentWidth, height = display.contentHeight - 80, onRowRender = onRowRender, onRowTouch = onRowTouch, listener = scrollListener } sceneGroup:insert(myList) for i = 1,numberOfCategories do myList:insertRow{ rowHeight = M.rowheight, isCategory = false, rowColor = { 1, 1, 1 }, lineColor = { 0.90, 0.90, 0.90 } } end