如何识别 corona sdk 中 table 中触摸的物体?

how to recognize objects touched in a table in corona sdk?

假设我在 corona 中有一个 table 视图,其中一个单元格包含这三个具有不同 ID 的对象,我可以识别行触摸,但我如何识别 [=24= 内触摸的对象] 查看?

这是我正在使用的代码

local function onRowRender( event )
  local row = event.row
  local rowHeight = row.contentHeight
  local rowWidth = row.contentWidth

  local speaker1 = display.newImage(row,"images/listen.png",70,70)
  speaker1.width = 20;speaker1.height = 20*ryx
  speaker1.x = 35;speaker1.y = suby
  speaker1.id = "speaker1"

  local eye1 = display.newImage(row,"images/eye.png",70,70)
  eye1.width = 20;eye1.height = 20*ryx
  eye1.x = 60;eye1.y = suby
  eye1.id = "eye1"

  speaker1:addEventListener("touch",onObjectTouch)
  eye1:addEventListener("touch",onObjectTouch)

end

local function onRowTouch( event )
    local phase = event.phase
    local row = event.target

    touchedRowIndex = row.index

    print(event.target.id)
    print(event.target)
    print(event.target.name)


  if ( "release" == phase ) then
    return true
  end
end

我尝试为每个对象使用触摸侦听器,但没有成功

 speaker1:addEventListener("touch",onObjectTouch)
  eye1:addEventListener("touch",onObjectTouch)

您在此处添加了 EventListener onObjectTouch,但您实现了 onRowTouch

您应该实施 onObjectTouch 或重命名添加的 EventListener。