Ios 卸下编辑附件按钮UITableViewCell
我有一个简单的表格视图,单元格如下 现在我想在这个表视图中实现拖放,这样用户就可以排列单元格了。所以我用了这个Ios 卸下编辑附件按钮UITableViewCell,ios,swift,tableview,Ios,Swift,Tableview,我有一个简单的表格视图,单元格如下 现在我想在这个表视图中实现拖放,这样用户就可以排列单元格了。所以我用了这个 func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { return true } func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPa
func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
return UITableViewCellEditingStyle.None
}
func tableView(tableView: UITableView, shouldIndentWhileEditingRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return false
}
func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath) {
let card = self.arrCards.objectAtIndex(sourceIndexPath.row) as! Card
self.arrCards.removeObjectAtIndex(sourceIndexPath.row)
self.arrCards.insertObject(card, atIndex: destinationIndexPath.row)
}
它是这样显示细胞的
所以这里我不想要三行按钮。我怎样才能卸下那个按钮。我希望拖放应该发生在用户拖动整个单元格时。我已尝试更改accessoryType、editingAccessoryType、accessoryView、editingAccessoryView。但到目前为止还没有运气 答案应该是帮助您删除视图,而不是更改其图像。答案是更改“重新排序”按钮的图像,但我想完全删除它。但在搜索后,我发现这是一个私人的,我不能删除它。否则苹果将拒绝该应用程序。所以我找到的更好的方法是实现长按手势,创建单元格快照,并用平移移动它。谢谢你的参考。删除视图仍然占用空间,我猜我无法更改。你的问题令人困惑。您想要实现标准的
UITableView
行重新排序,还是想要使用手势识别器进行自定义重新排序?我想要标准的重新排序,但不改变单元格的外观,我想要用户通过点击单元格上的任意位置来拖动并重新排列单元格