[英]swipe button issue in tableview in swift
我在表格视图中的尾随滑动时使用了 3 个按钮,但是当我在按钮部分中滑动时,两个按钮不可见,只有一个按钮可见,并且动作也会自动触发。
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let viewButton = UIContextualAction(style: .normal, title: "") { (contextualAction, view, boolValue) in
// View action
print("View action")
}
viewButton.backgroundColor = ColorSet.appSkyLightColor
viewButton.image = UIImage(named: "view")
//Approve
let approveButton = UIContextualAction(style: .normal, title: "") { (contextualAction, view, boolValue) in
// approve action
print("approve action")
}
approveButton.backgroundColor = ColorSet.appSkyLightColor
approveButton.image = UIImage(named: "accept")
//Reject
let rejectButton = UIContextualAction(style: .normal, title: "") { (contextualAction, view, boolValue) in
// Reject action
print("Reject action")
}
rejectButton.backgroundColor = ColorSet.appSkyLightColor
rejectButton.image = UIImage(named: "reject")
let swipeActions = UISwipeActionsConfiguration(actions: [rejectButton, approveButton, viewButton])
return swipeActions
}
swipeActions.performsFirstActionWithFullSwipe = false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.