gpt4 book ai didi

ios - 带有自定义 UITableViewCell 的 UITableView

转载 作者:行者123 更新时间:2023-11-28 17:46:50 26 4
gpt4 key购买 nike

我有 TableView 我有 UITableViewCell。在 UItableViewController 中我有 UITextField。在我点击 TextField 时的应用程序中。它是开放的。但是方法 – tableView:willSelectRowAtIndexPath: – tableView:didSelectRowAtIndexPath: 不起作用,因为我们不直接点击行。如何知道当前行的indexPath.row?

最佳答案

cellForRowAtIndexPath 方法中,通过将其标记属性设置为 indexPath.row 的值,将当前行分配给您的 UITextField

[yourTextfield setTag:indexPath.row];

当文本域完成编辑时,你可以读出它的标签属性,你就完成了。

关于ios - 带有自定义 UITableViewCell 的 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5326599/

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