gpt4 book ai didi

ios - 如何在 Storyboard Controller 中重用定义为原型(prototype)单元格的自定义 UITableViewCell

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

我有两个不同的 UITableViewControllers/TableViews 中项目的唯一单元格模板。我需要的是定义一次,然后通过

在其他 UITableView 中重用
UITableView.DequeueReusableCell(CellId);

问题是,当我在不包含单元格原型(prototype)的 UITableView 上调用此方法时,我得到的是 NULL。

如何跨多个表 Controller 重用我的原型(prototype)单元格?我想在 Storyboard 中定义单元格模板,而不是 xib。

最佳答案

事实证明,重用单元格的唯一方法是用 xib 设计它并在 tableview 上注册 xib 和 cellid。

关于ios - 如何在 Storyboard Controller 中重用定义为原型(prototype)单元格的自定义 UITableViewCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24190394/

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