tobihagemann / THLabel

UILabel subclass, which additionally allows shadow blur, inner shadow, stroke text and fill gradient.
https://tobiha.de
Other
665 stars 111 forks source link

Multiline text is showing in 1 line always #45

Closed aaasifrz9 closed 5 years ago

aaasifrz9 commented 5 years ago

I have set multiline text in UILabel and applied THLabel on it then it always showing text in a single line.

I have set IBOutlet @IBOutlet weak var label: THLabel!

Then in viewDidLoad

label.strokeSize = 3
label.strokeColor = UIColor.red

Its showing label text properly (see attached 'Normal.png') in multiline without THLabel. But after applying THLabel it always showing in a single line (see attached 'After applying THLabel.png').

Normal: normal

After applying THLabel: after applying thlabel

Please suggest how to integrate THLabel with multiple lines. Thanks in advance.

tobihagemann commented 5 years ago

From the notes in the README:

THLabel doesn't respect the numberOfLines property, because Core Text doesn't support it natively. If you would like to have multiple lines, set lineBreakMode to NSLineBreakByWordWrapping.