Reputation: 53
I am displaying text using UILabel. I want to display only 4 lines of text, if there is more text i have to append "..." at the end of fourth line. Any help on this is greatly appreciated. Thanks in advance.
Upvotes: 2
Views: 105
Reputation: 9836
lbl.lineBreakMode = UILineBreakModeTailTruncation;
lbl.numberOfLines = 4;
For iOS >= 6,
lbl.lineBreakMode = NSLineBreakByTruncatingTail;
lbl.numberOfLines = 4;
Upvotes: 1
Reputation: 108111
label.numberOfLines = 4;
label.lineBreakMode = NSLineBreakByTruncatingTail;
or in case you support iOS <= 5.
label.lineBreakMode = UILineBreakModeTailTruncation;
Upvotes: 3