我正在尝试以UITableView滑动样式添加图像.我尝试使用Emoji文本及其工作正常
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let editAction = UITableViewRowAction(style: .normal, title: "") { (rowAction, indexPath) in
print("edit clicked")
}
return [editAction]
}
Run Code Online (Sandbox Code Playgroud)
但我需要图像而不是表情符号,同时我试过
editAction.backgroundColor = UIColor.init(patternImage: UIImage(named: "edit")!)
Run Code Online (Sandbox Code Playgroud)
但它正在获得重复的图像,我使用了许多格式的图像,如20*20,25*25,50*50,但仍然重复.
我该如何添加图片?