Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: Set UITableViewRowAction button size

I have a short question: how can I programmatically set the UITableViewRowAction button size? Is there a specific native method or I have to make custom buttons for that? I have been struggling with this for many hours and search for an answer all over the internet.

Thanks!

like image 233
Catalin Cristian Avatar asked Dec 25 '22 12:12

Catalin Cristian


1 Answers

Unfortunately, you can't. The button is the height of the containing cell and the width of the string, plus 15 points of padding on the left and right. The only customizable properties of UITableViewRowAction are

  1. backgroundColor
  2. style
  3. title

You can fake a wider button by adding whitespace characters to the title string.

UITableViewRowAction

like image 193
Chris Droukas Avatar answered Jan 13 '23 10:01

Chris Droukas