如何使用quickdialog实现滑动删除

时间:2013-01-27 15:34:55

标签: objective-c iphone swipe quickdialog

我正在使用quickdialog表单和 我试图实现滑动删除,不知道我会怎么做。 有人能帮助我吗?

2 个答案:

答案 0 :(得分:2)

您可以使用QSortingSection代替QSection并将canDeleteRows设置为YES来滑动以删除节中的元素。

QSortingSection *foosection = [[QSortingSection alloc] init];
foosection.canDeleteRows = YES;

继续像往常一样添加元素,您应该能够滑动每个元素以显示“删除”按钮。点击删除按钮后,该项目将自动从该部分消失。

答案 1 :(得分:1)

答案是我认为是How to detect Swipe Gesture in iPhone SDK?

的组合

而且,您可能真正担心的是,如何Add/remove new QElement to the section(来自github问题)。

后者表明从一个部分删除元素(在此示例中为extraRepayAmount)的方法是:

[self.extraRepaySection.elements removeObject:self.extraRepayAmount];
[self.quickDialogTableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationFade];
相关问题