Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. display.setStatusBar( display.HiddenStatusBar )
  2.  
  3. local widget = require( "widget" )
  4. local tableView
  5.  
  6. local function onRowTouch( event )
  7.     if event.phase == 'tap' then
  8.         tableView:deleteRow(event.target.index)
  9.     end
  10. end
  11.  
  12. local function onRowRender( event )
  13.     local rowTitle = display.newText( event.row, "Delete row by touching (leave last row)", display.contentWidth/2, event.row.contentHeight * 0.5, nil, 14 )
  14.     rowTitle:setFillColor(0, 0, 0)
  15. end
  16.  
  17. tableView = widget.newTableView {
  18.     onRowRender = onRowRender,
  19.     onRowTouch  = onRowTouch,
  20. }
  21.  
  22. tableView:insertRow{rowHeight = 40}
  23. tableView:insertRow{rowHeight = 40}
  24. tableView:insertRow{rowHeight = 80}
  25. tableView:insertRow{rowHeight = 120}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement