我有一个UITableView。我向其中添加了一个UIGestureRecognizer,以便在单元格上检测到滑动手势时启用对该表的编辑。当我向右滑动时,确实可以在表上启用编辑功能。然而,当我向左滑动时,在单元格的右侧会出现默认的红色删除按钮。如何禁用这种默认行为,并使得无论我向左或向右滑动,都能够进入编辑状态?
- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer {
foldersTable.editing=YES;
}
- (void)viewDidLoad
{
[super viewDidLoad];
UIGestureRecognizer *recognizer;
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
[foldersTable addGestureRecognizer:recognizer];
[recognizer release];
}
UIGestureRecognizer *recognizer
的位置... 把它改成UISwipeGestureRecognizer *recognizer
- Benjamin Mayo