Mam UITableView i dodałem do niego akcje edycji. Teraz chcę dodać zdjęcie powyżej etykiecie Delete, jak:Jak dodać obraz na przycisku kasowania UITableView?
To jest mój kod:
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let blockAction = UITableViewRowAction(style: .Normal, title: "Block") { (rowAction:UITableViewRowAction, indexPath:NSIndexPath) -> Void in
//TODO: Delete the row at indexPath here
}
blockAction.backgroundColor = UIColor.redColor()
return [blockAction]
}
Jak mogę dodać zdjęcie na moim przycisku Delete
?
@rmaddy ale jak inni deweloperzy zrobić? –
Być może używają one niestandardowej klasy komórki widoku innej firmy i nie używają standardowego interfejsu API udostępnianego przez "UITableViewDelegate". – rmaddy
Skorzystaj z tego pytania, znajdziesz odpowiedź: http://stackoverflow.com/questions/20290766/change-the-color-of-default-red-color-delete-button-in-uitableviewcell-when- przesuń ---------------- http://stackoverflow.com/questions/29335104/how-add-custom-image-to-uitableview-cell-swipe-to -delete jeśli korzystasz z systemu iOS8 + –