gpt4 book ai didi

iphone - 如何检测用户何时滑动了可编辑的 UITableViewCell?

转载 作者:搜寻专家 更新时间:2023-10-30 19:55:29 24 4
gpt4 key购买 nike

我有一个可编辑的 UITableView。默认情况下,用户可以滑动并显示删除按钮。发生这种情况时,我想在我的 UITableView 单元格上隐藏一些元素。我该怎么做?

最佳答案

来吧:

tableView:willBeginEditingRowAtIndexPath:

...

Discussion

This method is called when the user swipes horizontally across a row; as a consequence, the table view sets its editing property to YES (thereby entering editing mode) and displays a Delete button in the row identified by indexPath. In this "swipe to delete" mode the table view does not display any insertion, deletion, and reordering controls. This method gives the delegate an opportunity to adjust the application's user interface to editing mode. When the table exits editing mode (for example, the user taps the Delete button), the table view calls tableView:didEndEditingRowAtIndexPath:.

Reference

然后扔一些[[cell viewWithTag:<#View's tag number#>] setHidden:YES]发表自己的看法。

关于iphone - 如何检测用户何时滑动了可编辑的 UITableViewCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7275450/

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