Reputation: 2002
I´v created a custom Cell for a tableview - that has some labels like the original but in the original when the text in the title label is longer than what fit´s on screen it appends "..." at the end. I´ve tried finding ways of doing it in IB with no luck. Do I have to create my own method to get this functionality on the UILabel?
Upvotes: 0
Views: 588
Reputation: 450
The default property for numberOfLines on a UILabel is 1, if you want to support a multiline label you need to specify the number of lines.
Such as:
myLabel.numberOfLines = 2;
You may also need to resize your label to account for the longer text or use a label that will fit the maximum number of lines.
Upvotes: 0
Reputation: 2002
Somehow I had managed to have two labels on top of each other and did not notice. SO the Label truncates the tail adding "..." automatically at the end if Line break mode is set to truncate tail. My bad - I guess if I were more experienced with iOS programming I should have known it does this automatically
Upvotes: 0
Reputation: 1544
You can use my UIExtendedLabel
Class From this link(check my ans) UIExtendedLabel
Upvotes: 1