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?
Asked
Active
Viewed 583 times
0
-
What does it do when you put a text much larger than it can hold, assuming your label has fixed font size enabled? – Zen Jun 28 '13 at 16:29
-
The label has a fixed font size, When I type the text statically in Interface Builder it truncate the tails and add the "...". But in the app - when the table list is populated dynamically it does not truncate the tail adding "..." at the tail – Tom Lilletveit Jun 28 '13 at 16:42
3 Answers
1
You can use my UIExtendedLabel
Class From this link(check my ans) UIExtendedLabel

Community
- 1
- 1

Prateek Prem
- 1,544
- 11
- 14
0
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.

Midhun MP
- 103,496
- 31
- 153
- 200

Kyle Richter
- 450
- 2
- 6
0
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

Tom Lilletveit
- 1,872
- 3
- 31
- 57