跨各种 UITableViews 的 UITableViewCell 原型单元格

Posted

技术标签:

【中文标题】跨各种 UITableViews 的 UITableViewCell 原型单元格【英文标题】:UITableViewCell prototype cell across various UITableViews 【发布时间】:2013-10-30 10:09:17 【问题描述】:

一个 UITableViewCell 原型单元似乎只能在一个 UITableView 下创建。如何使用故事板在不同的 UITableView 中使用相同的原型单元?

【问题讨论】:

【参考方案1】:

我认为你做不到。 我通常最终将 Cell 重构为一个单独的 XIB(您可以从 Storyboard 中复制/粘贴)然后调用:

- (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier

UITableViewviewDidLoad

【讨论】:

以上是关于跨各种 UITableViews 的 UITableViewCell 原型单元格的主要内容,如果未能解决你的问题,请参考以下文章

从 UITableView 的子类访问 UIScrollViewDelegate

UIScrollView 内的 UITableViews

带有 3 个 UITableViews 的 UIScrollView

带有自动布局的 UIScrollView 中的 UITableViews

一个 UIView 上的多个 UITableViews

如何在单独的 UITableviews 上显示 JSON 文件的内容?