1

I have created my custom action:

public override UITableViewRowAction[] EditActionsForRow(UITableView tableView, NSIndexPath indexPath)
    {
        //-------------------------------------------------
        // MORE Action
        //-------------------------------------------------
        var moreAction = UITableViewRowAction.Create(UITableViewRowActionStyle.Default,
                                                     "        ",
                                                     (_tableView, _indexPath) => ShowMoreAlert(tableView, indexPath));
        moreAction.BackgroundColor = UIColor.FromPatternImage(StyleKit.ImageOfList_MoreAction("More"));

        //-------------------------------------------------
        // DELETE Action
        //-------------------------------------------------
        var deleteAction = UITableViewRowAction.Create(UITableViewRowActionStyle.Default
                                                       ,"        ",
                                                       (_tableView, _indexPath) => ShowDeleteAlert(tableView, indexPath));
        deleteAction.BackgroundColor = UIColor.FromPatternImage(StyleKit.ImageOfList_DeleteAction("Delete"));


        return new UITableViewRowAction[] { deleteAction, moreAction };
    }

So, I would like to know how can I do to limit the swipe size, because I have an iusse when the user swipe the row all for the left side, look this image:

enter image description here

Carlos Bolivar
  • 307
  • 5
  • 12

2 Answers2

1

As far as I know, it is impossible to control the swipe size.

However , Apple provides another better way to create RowActions After iOS11.

We can override method GetTrailingSwipeActionsConfiguration to return UIContextualAction list.

UIContextualAction has property BackgroundColor and Image , it is more flexible than before.

Re: Offical Demo

ColeX
  • 14,062
  • 5
  • 43
  • 240
0

I had the same problem with my iOS native project. I fix that using image width. Please refer this Answer.

Isuru Jayathissa
  • 478
  • 4
  • 15