2016-08-09 105 views
0

是否可以在按下按钮(三个垂直点图标)后使表格单元向左滑动?按下按钮后滑出

这里有一个形象:

enter image description here

+0

http://t1p.de/uu43 –

回答

0

看一看方法: func deleteRowsAtIndexPaths(_ indexPaths: [NSIndexPath], withRowAnimation animation: UITableViewRowAnimation)

也许动画,你所追求的是UITableViewRowAnimation.Left

0

可以实现与此:

tableView.beginUpdates 

//Add code to update your dataModel 

tableView.deleteSections(NSIndexSet(index: indexPathOfRemovedCell.section), withRowAnimation: .Left) 

tableView.endUpdates() 
0

为了使表格单元格滑出向左按下按钮(三个垂直圆点图标)后,您可以编辑设置为true,如下: -

tableView.setEditing(true, animated: true) 

这将加载表编辑模式。编辑模式意味着在左侧显示红色减号。点击它,会显示删除按钮。

0

您可以尝试将cell.contentView的框架的原点x设置为“当前值 - buttonWidth”,并在另一个水龙头上将其设置为原来的水平。