gpt4 book ai didi

ios - 检测插入的单元格,然后让它成为 FirstResponder

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:14:39 25 4
gpt4 key购买 nike

对于我的自定义单元格,举个简单的例子,我只有一个 UITextField,有没有办法让 刚刚插入的单元格 becomeFirstResponder insertRowsAtIndexPaths ?

我需要一种方法来检测它,以便它在插入后和插入动画结束时成为第一响应者。

有什么想法,甚至接近吗?

谢谢

最佳答案

像这样的东西??

- (void) insertRows
{
.
.
.

[tableView beginUpdates];
[tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight];
[tableView endUpdates];

NSIndexPath p = [indexPaths lastObject];

MyCustomCell *cell = [cellForRowAtIndexPath:p];
[cell.textField becomeFirstResponder];
}

关于ios - 检测插入的单元格,然后让它成为 FirstResponder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15926205/

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