How to customize a mutiline label on iPhone?
-
03-07-2019 - |
Question
How to let a label show multi-line strings?
e.g. The given string is @"HelloA\nHelloB\nHelloC\n".
How to show it like:
@"HelloA"
@"HelloB"
@"HelloC"
Solution
I find some properties to customize UILabel:
label.numberOfLines = 3;
label.adjustsFontSizetoFitWidth = YES;
label.minimumFontSize = 8.0f;
And '\n' can be used as tail truncation mark.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow