开发者

Delete button uitableview cell; a bit jumpy?

开发者 https://www.devze.com 2023-02-03 23:45 出处:网络
When i set a table into editing mode and try to delete a cell, i am having issues with the \"delete\" button playing hide and see :)

When i set a table into editing mode and try to delete a cell, i am having issues with the "delete" button playing hide and see :)

When i tap on the "minus" symbol, the delete button pops in but seems to be a bit jumpy, have to try a few times to get an actual tap on th开发者_开发技巧e delete button. Am not sure what the reason is

Any suggestsions?

p.s: I have edited this question. Previously it was in regard to swipe and delete, but i believe the problem is also with the regular delete.


To show delete button set tableView.editing property to YES and implement delegate's editingStyleForRowAtIndexPath method and return appropriate editing style (None, Insert or delete) for each cell.


Im just shooting in the dark as i have'nt seen your code.

if you are detecting swipe through the old touchesBegan: withEvent: touchesMoved:withEvent: approach,this might happen as you are touching the cell.

With the new UISwipeGestureRecognizer in iOS 4.0, you could handle the swipe so easily.

IMHO.add a member variable to your UITableView subclass as BOOL isDeleteButtonVisible and use UISwipeGestureRecognizer to detect the swipe,then in the make the button visible and set the member variable.

In the touchesBegan: withEvent: method,check the button visibility by checking the isDeleteButtonVisible member variable and hide it if it is visible.

Im just giving you some hints.


have you tried this on an actual device? I was thinking the same about my tableview. It was running in the simulator and it was really difficult to do the right gesture or to hit the button.

But on the device it felt like it should be.

0

精彩评论

暂无评论...
验证码 换一张
取 消