我已经创建了我的自定义操作:
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 };
}因此,我想知道如何限制滑动大小,因为我有一个iusse,当用户在左侧滑动所有行时,请看这张图片:

发布于 2017-11-08 15:04:54
据我所知,不可能控制滑动的大小。
然而,苹果提供了继iOS11之后创建RowActions的另一种更好的方式。
我们可以重写方法GetTrailingSwipeActionsConfiguration来返回UIContextualAction list。
UIContextualAction具有属性BackgroundColor和图像,比以前更加灵活。
回复:Offical Demo
发布于 2018-03-22 15:33:23
我的iOS原生项目也遇到了同样的问题。我用图像宽度解决了这个问题。请参考此Answer。
https://stackoverflow.com/questions/47162024
复制相似问题