gpt4 book ai didi

swift - 点击后编辑单元格名称 - Swift

转载 作者:行者123 更新时间:2023-11-28 12:22:45 24 4
gpt4 key购买 nike

我想通过点击来编辑单元格中的文本,我想知道除了添加文本字段之外是否还有其他方法可以做到这一点。我错过了 TableView 委托(delegate)中的某些内容吗?

最佳答案

您可以创建符合 UITextInput 协议(protocol)(或者 UIKeyInput 就足够了)的单元格(或任何其他 UIResponder 子类)。这里很简单 example ( old link )

注意,

  • 您应该设置 cell.canBecomeFirstResponder = true
  • 显示键盘使用 cell.becomeFirstResponder()

也许还有其他事情是您应该做的。我建议阅读文档。

...或者使用 UITextField :)

关于swift - 点击后编辑单元格名称 - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44295113/

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