gpt4 book ai didi

ios - 如何快速减少表格 View 中单元格的 swipeAction 距离? (如 WhatsApp 上下文回复功能)

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

这是我正在使用的操作。滑动操作执行向右长滑动的第一个操作。如何仅向右滑动一半即可执行此操作

let modifyAction = UIContextualAction(style: .normal, title:  "", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("yess....")
success(true)
})
modifyAction.image = UIImage(named: "cross")
modifyAction.backgroundColor = AppColors.blackColorWith0PercentOpacity

let action = UISwipeActionsConfiguration(actions: [modifyAction])
action.performsFirstActionWithFullSwipe = true
return action

最佳答案

除了触摸和移动屏幕外不滑动任何内容。

通过在 viewController 或 UITableView 上覆盖 touchesBegantouchesMovedtouchesEnded,您可以编写自己的滑动并决定如何测量全、半滑动。

关于ios - 如何快速减少表格 View 中单元格的 swipeAction 距离? (如 WhatsApp 上下文回复功能),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55219378/

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