Hi,
I have a tableview with a number of items, each of these items have a touch event.
I am pretty much trying to create a list of selectable items (checkboxes).
I have managed to get it so when you click on an item it adds it to a dictionary and keeps count of the items so you can add and remove them no problem.
However I want some kind of visual effect to occur on the item (either an image change or a background color change), how would I access the background in a list view, below is a copy of my code from the touch event:
[lua]local removeItem=false
local position=1
for k,v in ipairs(checkedItems) do
if (v==data[self.id].item_id) then
table.remove(checkedItem,position)
removeItem=true
end
position=position+1
end
– If the item wasn’t found in chosen list then insert it
if (removeItem==false) then
data[self.id]:setFillColor(255,0,0)
table.insert(checkedItem,data[self.id].item_id)
end[/lua]
the line data[self.id]:setFillColor is failing as data[self.id] doesn’t have that kind of property, if it was a normal button with a touch event I guess this would work but because its a list view / table view its not… can this be done?
Thanks
Edit: On top of this, does anyone know if it is possible to add onPress events on listview items rather than just onReleased? [import]uid: 72726 topic_id: 14476 reply_id: 314476[/import]