How add custom image to uitableview cell swipe to delete

后端 未结 3 584
有刺的猬
有刺的猬 2020-12-30 09:03

Could you tell me, how to add custom image to delete button when swipe cell on UITableview?

3条回答
  •  天命终不由人
    2020-12-30 09:38

    search you need function "editActionsForRowAtIndexPath", where you create scope of actions. You need to set UIImage to backgroundColor of UITableViewRowAction.

    let someAction = UITableViewRowAction(style: .Default, title: "") { value in 
        println("button did tapped!")
    }
    someAction.backgroundColor = UIColor(patternImage: UIImage(named: "myImage")!)
    

提交回复
热议问题