0

I want to custom my delete button of the UITableViewCell like these codes:

let deleteAciont = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: nil, handler: {action, indexpath in
        do some thing
    });
    deleteAciont.backgroundColor = UIColor(patternImage: UIImage(named: "delete")!)

the height of the UITableViewCell is 70 like this:

override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
    return 70
}

and the images are these size: delete.png:70*70\delete@2x.png:140*140\delete@3x.png:210*210 delete image

but when i swipe left, the image only show half: enter image description here

I have been confusing about this for a long time and thanks for your help

Boli-CS
  • 550
  • 1
  • 5
  • 14

1 Answers1

1

the length of the tableViewRowAction will be the title's length

let deleteAciont = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: " type more space here ", handler: {action, indexpath in do some thing });

Liang
  • 9
  • 2