Hi all,
I’m having a little difficulty using the different phases of the touch event. I’m using a listView, which is part of the Widget class. The problem I’ve encountered is that, when scrolling, if a user holds their finger down on a particular row for too long, it selects that row. Instead, what I’d like for it to do is only select a particular row if the user touches and releases a row without scrolling.
I thought that I could solve this problem by using the different phases of the touch event, as follows:
[lua]
local function onRowTouch( event )
local phase = event.phase
local row = event.row
if “ended” == phase then
if row.index == 1 then
detailType = nil
storyboard.gotoScene(“scripts.take_pic”, “fade”, 300)
elseif row.index == table.maxn(listOfTypes) then
storyboard.gotoScene(“scripts.take_pic”, “fade”, 300)
else
detailType = listOfTypes[row.index]
– change scene to take_pic
storyboard.gotoScene(“scripts.take_pic”, “fade”, 300)
end
return true
end
end
[/lua]
However, when I implement this, I can no longer select a row at all, even if I don’t scroll through the list.
Any suggestions?