I have a label and I insert text in it. The label has a size but my problem is this:
when I insert text in label if the text is longer than label'size appears "...." in the label; for example:
if complete string that I want insert in the label is this : "hello world how are you?"
in the label I see this "hello world..."
I would like that label wraps automatically.
For this reason I did this but it doesn't work:
label!.textAlignment = NSTextAlignment.Center;
label!.numberOfLines = 0;
label!.font = UIFont.systemFontOfSize(16.0);
label!.text = "hello world how are you?"
Where do I wrong?
label.lineBreakMode = .byWordWrapping
label.numberOfLines = 0;
or adjust the font size as below to fit the whole string
label.adjustsFontSizeToFitWidth = true
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