How add custom image to uitableview cell swipe to delete

被刻印的时光 ゝ 提交于 2019-11-30 13:27:20

问题


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


回答1:


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")!)


来源:https://stackoverflow.com/questions/29335104/how-add-custom-image-to-uitableview-cell-swipe-to-delete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!