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.
My understanding is that one can only use 1 subtitle per cell.
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???
Just subclass UITableViewCell, and add in multiple UILabel's. Then override the layoutSubviews method to position those labels. Then in the cellForRow, make sure you instantiate your subclassed UITableViewCell. I don't have time to check this, but the subclass would look something like:
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
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.
From the image provided, it looks like the prototype
UITableViewCell
contains oneUIImageView
and 5UILabel
s. Assuming you are using IB or storyboard to create the table view cell, set the 'Table View Style' to Custom, than drag aUIImageView
and 5UILabel
s onto the prototype cell. For each of theUILabel
s, adjust their position, font and font size as desired. You may also need to adjust the height of the cell.Hey I have created a Sample Project regarding Custom Cell check this github link that I have created. I have used storyboard. here is the screenshot of the sample app![enter image description here](https://i.stack.imgur.com/3Kq2B.png)