TableView adding, deleting, renaming and moving rows around

Hi,
I need help on TableView. Yes, I have a lot of questions.

  1. How do I rename rows in a TableView? I want a user to be able to tap an already created row, and a keyboard will come up for the user to edit to name of the row.

  2. How can I edit the animation for TableView deletion? Currently, if a row is deleted the row slides to the left. What if I want it to fade, or slide to the right/up/down?

  3. How can I change the animation for adding rows into a TableView?

  4. Currently, rows add into the TableView at the bottom. How do I add it to the top or into a certain spot in the TableView, between two rows?

  5. How do I move rows around? Can I make it so that the user can drag and drop rows around? Or do I need to rename the swapped rows?

Thanks!

  1. You would need to write code to trigger the native keyboard, save the result into a variable, and then use tableView:reloadData() to refresh the contents. (There are probably a few other ways to refresh contents, but that’s the most obvious)

  2. The widgets are meant to mimic standard iOS objects. If you want to make it visually behave differently, you will need to grab the open source version of the widgets (Corona provides it via github) and make some changes yourself.

  3. See #2

  4. Best guess: generate your tableView contents using a table, insert content at a new position, and then reload. Not visually reactive but it would give you the order you want.

  5. See #2, although pretty sure someone here has made a custom widget edit that lets you do drag’n’drop rows already. Search the forum…

  1. You would need to write code to trigger the native keyboard, save the result into a variable, and then use tableView:reloadData() to refresh the contents. (There are probably a few other ways to refresh contents, but that’s the most obvious)

  2. The widgets are meant to mimic standard iOS objects. If you want to make it visually behave differently, you will need to grab the open source version of the widgets (Corona provides it via github) and make some changes yourself.

  3. See #2

  4. Best guess: generate your tableView contents using a table, insert content at a new position, and then reload. Not visually reactive but it would give you the order you want.

  5. See #2, although pretty sure someone here has made a custom widget edit that lets you do drag’n’drop rows already. Search the forum…