有没有办法将此图标添加到 UITableViewRowAction
当 UITableView
的UITableViewCell
向右滑动,未设置patternImage
UITableViewRowAction
的的背景?
即添加访问此图标:
写入以下代码:
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .destructive, title: "", handler: {})
}
最佳答案
这目前还不可能,但在 iOS 11 中将成为可能。以下是实现这些自定义操作的教程:
https://developerslogblog.wordpress.com/2017/06/28/ios-11-swipe-leftright-in-uitableviewcell/
关于iOS:Swift 中 UITableViewCell 的垃圾桶删除按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45277427/