如何创建具有多个字幕的 UITableCell [英] How to create a UITableCell that has multiple subtitles
问题描述
我在网上看到了这个设计图,我真的很困惑如何制作一个具有多个字幕的 UITableCell 并允许我按照图片所示的方式自定义它们.
I came across this design image online and I am really puzzled on how could I make a UITableCell that has multiple subtitles and allows me to customised them in the way shown by the picture.
我的理解是每个单元格只能使用 1 个字幕.
My understanding is that one can only use 1 subtitle per cell.
有没有办法创建一个看起来像这样的 UITable 单元格?你将如何继续在单元格标题下制作这 4 个字幕???
Is there a way to create a UITable cell that looks like that? How would you go on to make those 4 subtitles under the cell title???
推荐答案
您可以通过为 UITableViewCell 自定义布局来轻松做到这一点.该视频应该可以帮助您做到这一点:
You could do that easily by having a custom layout for the UITableViewCell. This video should help you in doing this:
http://www.youtube.com/watch?v=d_kO-J3DYvc
基本上,您需要在 storyboard/NIB 文件中设计单元格的 UI,并在那里为表格单元格添加多个标签.子类 UITableViewCell 并将其链接到 storyboard/NIB 中设计的 UITableViewCell.在该类中为标签添加 IBOulet,并将您的标签从 UI 链接到这些 IBOutlets.
Basically you will need to design the UI of the cell in storyboard/NIB file and add multiple labels to your table cell there. Sub-class UITableViewCell and link it to the designed UITableViewCell in storyboard/NIB. Addd IBOulets in that class for the labels and link your labels from the UI to these IBOutlets.
这篇关于如何创建具有多个字幕的 UITableCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!