Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local widget = require "widget"
- local onItemRelease = function( event )
- print( "You touched item: " .. event.target.id )
- end
- --
- local itemData = {
- {
- title = "First Item",
- onRelease = onItemRelease,
- icon = {
- image = "myicon.png",
- width = 32,
- height = 32,
- base = system.ResourcesDirectory,
- padding = 15,
- paddingTop = 20
- }
- },
- {
- -- CATEGORY (just one key)
- categoryName = "My Category"
- },
- {
- -- ANOTHER ITEM:
- title = "Second Item",
- onRelease = onItemRelease,
- icon = {
- image = "myicon.png",
- width = 32,
- height = 32,
- base = system.ResourcesDirectory,
- padding = 15,
- paddingTop = 20
- }
- }
- }
- --
- --print(table.getn(itemData))
- local myList = widget.newTableView{ rowHeight = 60, width = 600}
- --populate list from table:
- myList:sync( itemData )
Add Comment
Please, Sign In to add comment