I had a tableview from previous test so I tried your case. My example has a strange problem. If you touch checkbox first the touch does not leak through. But if you touch a row and then the checkbox the touch goes through.
Can someone shed some light on this?
This is code to reproduce:
[lua]
display.setStatusBar( display.HiddenStatusBar )
local widget = require( “widget” )
local function onRowTouch( event )
if event.phase == ‘tap’ then
print (“Row touch”)
end
end
local function checkBoxEvent(event)
if event.phase == “began” then
print(‘Checkbox touch’)
end
return true
end
local function onRowRender( event )
local row = event.row
local rowTitle = display.newText( row, "TEST " … row.index, 0, 0, nil, 14 )
rowTitle.x = display.contentWidth / 2
rowTitle.y = row.contentHeight * 0.5
rowTitle:setTextColor( 0, 0, 0 )
local check = display.newRect(row, 0, 0, 10, 10)
check.x = 10
check.y = row.contentHeight * 0.5
check.strokeWidth = 2
check:setFillColor(140, 140, 140)
check:setStrokeColor(180, 180, 180)
check : addEventListener(“touch”, checkBoxEvent)
end
local tableView = widget.newTableView {
width = display.contentWidth,
height = display.contentHeight,
onRowRender = onRowRender,
onRowTouch = onRowTouch,
}
tableView:insertRow{rowHeight = 40}
tableView:insertRow{rowHeight = 40}
tableView:insertRow{rowHeight = 40}
[/lua]