你的位置:首页 > 软件开发 > 操作系统 > UITabelview的删除

UITabelview的删除

发布时间:2017-01-15 00:00:15
删除的效果 AutomaticBottomFadeleftmiddlenonerighttop 简单删除先删除数据源里的数据,然后再删除cell,否者会报错 let indexPath = NSIndexPath.init(forRow: 1, inSection: 0) ...

UITabelview的删除

  1. 删除的效果

    • Automatic同样是先插入数据,再插入cell。

      self.titles.insert("insert", atIndex: 1)self.tableView?.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Left)
    • 同时删除和插入

      • 准备数据源
      • 调用beginUpdates()
      • 调用deleteRowsAtIndexPaths, insertRowsAtIndexPaths:等方法
      • 调用endUpdates方法
    • 对indexPath进行操作的次序

      • 在一个animation block(beginUpdates()endUpdates之间的部分)中,所有的插入选择操作都发生在删除操作之后
      • 删除和reload操作的指定的indexpath是原来tableView(未发生动画之前)的indexPath
      • 插入操作指定的indexPath是前面代码执行完成以后的新tableView的indexPath。

        原标题:UITabelview的删除

        关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。