zoukankan      html  css  js  c++  java
  • uitableviewcell侧滑删除等

    iOS8新增api,重写下2个代理方法

     func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {

            return true

     }

        

    func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {

            

            let deleteAction = UITableViewRowAction.init(style: UITableViewRowActionStyle.destructive, title: "删除") { (rowAction, indexPath) in

            }

            

            let editAction = UITableViewRowAction.init(style: UITableViewRowActionStyle.default, title: "编辑") { (rowAction, indexPath) in

            }

            editAction.backgroundColor = UIColor.init(hexString: "d2d2d2")

            

            return [deleteAction,editAction]

      }

  • 相关阅读:
    个人总结
    团队作业五
    个人项目五:个人回顾
    第二次冲刺
    第一次冲刺
    猜数字1
    随机数
    个人作业
    课后作业1
    作业
  • 原文地址:https://www.cnblogs.com/Leean/p/6836542.html
Copyright © 2011-2022 走看看