Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- display.setStatusBar( display.HiddenStatusBar )
- local widget = require( "widget" )
- local tableView
- local function onRowTouch( event )
- if event.phase == 'tap' then
- tableView:deleteRow(event.target.index)
- end
- end
- local function onRowRender( event )
- local rowTitle = display.newText( event.row, "Delete row by touching (leave last row)", display.contentWidth/2, event.row.contentHeight * 0.5, nil, 14 )
- rowTitle:setFillColor(0, 0, 0)
- end
- tableView = widget.newTableView {
- onRowRender = onRowRender,
- onRowTouch = onRowTouch,
- }
- tableView:insertRow{rowHeight = 40}
- tableView:insertRow{rowHeight = 40}
- tableView:insertRow{rowHeight = 80}
- tableView:insertRow{rowHeight = 120}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement