表格单元格中的标签
我想在表格的单元格中添加标签。在我的例子中,单元格是使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的其他文件是 UITableViewCell 的子类,您可以:
您通常会将指向表视图单元格内容的指针传递给单元格 init 方法,以便单元格可以使用正确的方法初始化自身型号信息。
如果选择方法 1,您通常还应该检索单元格内容视图大小,以便以编程方式放置元素。
祝您好运。
If your other file is a subclass of UITableViewCell you can:
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.