Reputation: 91
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!
Upvotes: 4
Views: 4567
Reputation: 2296
For Width: You can add an empty string to:
UITableViewRowAction(style: .Destructive, title: " ")
It can helps to setup width not exactly (non-pixels accuracy)
For Height: Set cell height in TableView.
Upvotes: 3
Reputation: 3196
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
You can fake a wider button by adding whitespace characters to the title string.
Upvotes: 7