滑动即可在已处于编辑模式时进行删除 [英] swipe to delete when already in edit mode

查看:134
本文介绍了滑动即可在已处于编辑模式时进行删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iphone应用程序使用uitableview,我想重新排序控件始终显示,并让用户滑动删除行。



我现在采取的方法是将表格放在编辑模式,并允许在编辑模式下选择

  self.tableView.editing = YES; 
self.tableView.allowsSelectionDuringEditing = YES;

然后使用

隐藏红色删除圈子

   - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 
{
return UITableViewCellEditingStyleNone;
}

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
return NO;
}

我无法弄清楚如何获得滑动手势, 在右侧当表格已经处于编辑模式时,有人可能指向正确的方向?



或者,如果有人知道如何获得单元格重排序控件

解决方案



/ div>

我想知道你现在的方向是否会破坏人机界面指南,这将导致应用程序无法获得批准。



我不明白为什么你不能捕获滑动手势,然后使用它来取消隐藏删除确认的红色删除(停止标志)图标?


I have an iphone app using a uitableview where I'd like the "reorder" controls to always be displayed, and have the user swipe to delete rows.

The approach I'm currently taking is to put the tableview in edit mode and allow selection in edit mode

self.tableView.editing = YES;
self.tableView.allowsSelectionDuringEditing = YES;

I then hide the red delete circles using

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleNone;
}

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
    return NO;
}

I cant figure out how to get the swipe gesture to bring up the "delete" on the right side when the tableview is already in edit mode, can somebody point me in the right direction?

alternatively, if someone knows how to get the cell reordering controls to show when NOT in edit mode, that would also be a workable solution

cheers

解决方案

I'm wondering if the way you're headed now would break the Human Interface guidelines, which would result in the app not getting approved.

I can't see why you can't capture the swipe gesture and then use that to 'unhide' the red delete (stop sign) icons for the delete confirmation?

这篇关于滑动即可在已处于编辑模式时进行删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆