【发布时间】:2015-11-27 13:45:11
【问题描述】:
我有一个带有自定义 UITableViewCells 的 TableView。我为我的表格视图单元启用了 UILongPressGestureRecognizer。在长按手势识别器时,我想编辑我的表格视图。现在在 tableview 的编辑模式下,所有被选中的单元格都被选中,以及附属的复选标记按钮。我只想选择附件复选标记按钮,而不是整个单元格。我尝试了多个选项,例如将单元格的 selectionStyle 属性设置为 UITableViewCellSelectionStyleNone 。在这种情况下,我无法在编辑模式下选择单元格。
-(void)addLongPressGestureRecognizerForCell:(UITableViewCell *)tableViewCell{
UILongPressGestureRecognizer *lLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressGestureFunction:)];
lLongPressGesture.minimumPressDuration = 0.3;
lLongPressGesture.delegate = self;
[tableViewCell addGestureRecognizer:lLongPressGesture];
[lLongPressGesture setCancelsTouchesInView:NO];
}
如何实现这个功能?
【问题讨论】:
-
识别器方法的邮政编码
-
也许修改委托调用并手动更改选择样式?
标签: ios iphone tableviewcell edit-tableview