表格单元格中的标签

发布于 2024-10-22 02:51:38 字数 83 浏览 7 评论 0原文

我想在表格的单元格中添加标签。在我的例子中,单元格是使用 UITableViewCell 从另一个文件生成的。有什么指导吗?

谢谢...

I want to add a label into the table's cell. In my case the cell is generated from another file using UITableViewCell . any guidance ?

Thanks...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小情绪 2024-10-29 02:51:38

如果您的其他文件是 UITableViewCell 的子类,您可以:

  1. 定义 UITableViewCell 视图 以编程方式
  2. 使用 NIBfile 定义视图

您通常会将指向表视图单元格内容的指针传递给单元格 init 方法,以便单元格可以使用正确的方法初始化自身型号信息。

如果选择方法 1,您通常还应该检索单元格内容视图大小,以便以编程方式放置元素。

祝您好运。

If your other file is a subclass of UITableViewCell you can:

  1. define the UITableViewCell view programmatically
  2. define the view using a NIBfile

You would typically pass a pointer to the content of your table view cell to the cell init method so the cell can initialize itself with proper model information.

You should also typically retrieve the cell content view size to place your elements programmatically if you choose method 1.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文