I want to draw a paragraph (so i guess using CTFrameDraw or ctlinedraw) but i also need to truncate the text if it not fit in the defined area (rect). Normally we trim the last line by appending an ellipsis (ie the characters '...') How to do this ? How to do this with special char like '...[+]'
Also, i would like to know how to specify an indent (in pixel) for the very first line and if it's possible de define custom linespacing
and to finish, i need to know the exact final rect that will fit exactly the full paragraph (it's maybe lower than the defined area)
NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc] init];
paragraph.lineBreakMode = NSLineBreakByTruncatingTail;
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraph range:NSMakeRange(0, [attributedString length])];
descriptionLabel.attributedText = attributedString;
Use above code and to your UIelement
label or button like this .U will get ellipses at the last line. And i am also tried to append string at end but i didnot. because in limited area the label shows fit information only remaining hides .On that line means except ellipses i tried some text.Sorry to giving less info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With