Has anyone implemented this before? I have a table view and I want to show a delete button when the user swipe left? How would I go about this? Any tips or code would be appreciated
In your onRowRender place a delete button in the row being rendered then hide it with button.alpha = 0. In your event listener add code to catch the slide event and simply turn alpha = 1. Hope that helps
I had to have one, so I got one working.
Just like ksan said, I spawn a Delete button with each row of my scrollview, but I spawn it to the right of the scrollview content and capture the left swipe in the “moved” phase of the touch event and trigger a transition for the Delete button so it slides into view. I really like the new iOS 7, cause we don’t have to have any images to create the buttons.
The code is really simple, but
Nail
@xnailbender, that’s nice!!! I am slowly getting into the IOS 7 look & feel transition so I definitely want to try this. Did you also find a way to shift your row content to left as you slide your Delete button into view from the right?
If you want to have it be iOS 7 like, you would put the button behind the “row background” rectangle and then when swiping transition the background row to the left to reveal the button. You may need to put a tap handler on the background image to make sure taps don’t slip through.
Rob
ksan, my app would definitely be described as a work in progress.
After reading Robs suggestion, I went back and placed the button behind the row and eliminated the “Delete” button transitions and added transitions to the row and it’s text, so now I’ve got more “7” like…
I’ve got 1 glitch I can’t figure out. I’m using a modified Widget 1.0 and when I transition my row left, it is moving beyond the left edge of the mask by 5 pixels…hmmmm
Nail
Ok. This gives me a lot of pointers to follow. Thanks much!!!
Thanks guys! I got it working
In your onRowRender place a delete button in the row being rendered then hide it with button.alpha = 0. In your event listener add code to catch the slide event and simply turn alpha = 1. Hope that helps
I had to have one, so I got one working.
Just like ksan said, I spawn a Delete button with each row of my scrollview, but I spawn it to the right of the scrollview content and capture the left swipe in the “moved” phase of the touch event and trigger a transition for the Delete button so it slides into view. I really like the new iOS 7, cause we don’t have to have any images to create the buttons.
The code is really simple, but
Nail
@xnailbender, that’s nice!!! I am slowly getting into the IOS 7 look & feel transition so I definitely want to try this. Did you also find a way to shift your row content to left as you slide your Delete button into view from the right?
If you want to have it be iOS 7 like, you would put the button behind the “row background” rectangle and then when swiping transition the background row to the left to reveal the button. You may need to put a tap handler on the background image to make sure taps don’t slip through.
Rob
ksan, my app would definitely be described as a work in progress.
After reading Robs suggestion, I went back and placed the button behind the row and eliminated the “Delete” button transitions and added transitions to the row and it’s text, so now I’ve got more “7” like…
I’ve got 1 glitch I can’t figure out. I’m using a modified Widget 1.0 and when I transition my row left, it is moving beyond the left edge of the mask by 5 pixels…hmmmm
Nail
Ok. This gives me a lot of pointers to follow. Thanks much!!!
Hey,
Can someone please post a sample of tableView with delete button using the latest corona sdk (graphics 2.0, widget 2.0)
Thanks.
Thanks guys! I got it working
Hey,
Can someone please post a sample of tableView with delete button using the latest corona sdk (graphics 2.0, widget 2.0)
Thanks.