zoukankan      html  css  js  c++  java
  • ios8 新特性 UITableViewRowAction

    // 原滑动删除方法,需保留
        override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
            
        }
        
        // 滑动删除与编辑
        override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
            
            var editAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "编辑") {
                (action: UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
                
               // 编辑的业务逻辑


            }
            
            var deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "删除") {
                (action: UITableViewRowAction!,indexPath: NSIndexPath!) -> Void in
                
               // 删除的业务逻辑


            }
            
            // 设置背景颜色
            editAction.backgroundColor = UIColor.lightGrayColor()
            deleteAction.backgroundColor = UIColor.redColor()
            return [deleteAction, editAction]
        }

     
  • 相关阅读:
    代码1
    js中级第13天
    dom 浏览器模型
    js中级第12天
    js中级第11天
    js中级第十天
    js中级第九天
    js中级第8天
    js中级第六天
    js中级第七天
  • 原文地址:https://www.cnblogs.com/lisen-lisen/p/4826142.html
Copyright © 2011-2022 走看看