gpt4 book ai didi

ios - UITableViewRowAction 限制大小

转载 作者:行者123 更新时间:2023-11-29 11:40:00 26 4
gpt4 key购买 nike

我已经创建了自定义操作:

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,看这张图片:

enter image description here

最佳答案

据我所知,无法控制滑动大小。

但是,Apple 在 iOS11 之后提供了另一种更好的创建 RowActions 的方法。

我们可以覆盖方法 GetTrailingSwipeActionsConfiguration 以返回 UIContextualAction 列表。

UIContextualAction 有属性 BackgroundColorImage ,比以前更灵活。

回复:Offical Demo

关于ios - UITableViewRowAction 限制大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47162024/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com