gpt4 book ai didi

ios - UITableViewCell中的UITextField插入后成为FirstResponder

转载 作者:搜寻专家 更新时间:2023-10-30 22:18:36 26 4
gpt4 key购买 nike

<分区>

如标题所述,我在 UITableViewCell 中有一个 UITextField

我的 tableView 列出了名为 tallies: [String] 的数组中的项目

我在点击按钮时插入一个新条目,并在新单元格中设置动画。我希望 titleTextFieldrowAnimation 完成后成为 becomeFirstResponder,但到目前为止无法让它工作。

新行动画完美,但 titleTextField 不会 becomeFirstResponder

这是我尝试过的:

CATransaction.begin()
CATransaction.setCompletionBlock {
let cell = self.tableView(self.tableView, cellForRowAtIndexPath: self.editingIndexPath!) as! TallyCell
cell.titleTextField.hidden = false
cell.titleTextField.becomeFirstResponder()
}

tableView.beginUpdates()
tallies.append("Example")
tableView.insertRowsAtIndexPaths([editingIndexPath!], withRowAnimation: .Left)
tableView.endUpdates()

CATransaction.commit()

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