【发布时间】:2018-10-22 07:28:19
【问题描述】:
我正在使用以下代码:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = CellView(style: UITableViewCellStyle.default , reuseIdentifier: nil)
let selectView = UIView()
selectView.backgroundColor = UIColor(patternImage: UIImage(named:"ScrollImageTop1")!)
cell.selectedBackgroundView = selectView
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath) as! CellView
remove(item: indexPath.item)
}
func remove(item : Int)
{
tableRows -= 1
tableView1.deleteRows(at: [IndexPath(item: item, section: 0)], with: .top)
}
我无法理解如何增加单元格删除的动画时间。请帮助我在这里实施相同的操作。非常感谢您的帮助。谢谢。
【问题讨论】:
-
没有这样的标准 iOS API 可以实现这一点。
-
@HimanshuMoradiya 我认为这不是他 OP 要求的,他问的是改变动画的 duration,而不是检测它。
-
@AhmadF 那么不可能