iOS Question CSBuilder Multiline Wrap Text

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
I have this code:

B4X:
Dim cs As CSBuilder
    cs.Initialize.Alignment("ALIGN_CENTER").Font(Font.CreateFontAwesome(18)).Font(Font.DEFAULT_BOLD).Color(Colors.ARGB(255, 255,220,115)).Append($"BENVENUTO IN PIZZERIA"$).Append(CRLF).Append(CRLF).PopAll
    cs.Font(Font.CreateFontAwesome(14)).Font(Font.DEFAULT_BOLD).Color(Colors.White).Append($"Inserisci le tue credenziali per accedere oppure Registrati."$).Append(CRLF).PopAll
    cs.Font(Font.CreateFontAwesome(14)).Font(Font.DEFAULT_BOLD).Color(Colors.White).Append($"La registrazione dura meno di un minuto e ci permette di sapere dove consegnare le pizze."$).Append(CRLF).PopAll
    cs.Font(Font.CreateFontAwesome(14)).Font(Font.DEFAULT_BOLD).Color(Colors.White).Append($"Nel campo ID PIZZERIA inserisci il numero fornito dalla Pizzeria"$).Append(CRLF).PopAll
    cs.Font(Font.CreateFontAwesome(14)).Font(Font.DEFAULT_BOLD).Color(Colors.White).Append($"Grazie per averci scelto."$).Append(CRLF).PopAll
    Label1.AttributedText = cs

This is effect:

20180227_091239.jpg


it does not wrap automatically, why ?

In attachment example

Thank you
 

Attachments

  • TestCSBuilder.zip
    124.3 KB · Views: 337

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why are you setting the text line by line?

B4X:
Dim cs As CSBuilder
    cs.Initialize.Alignment("ALIGN_CENTER").Font(Font.CreateFontAwesome(18)).Font(Font.DEFAULT_BOLD).Color(Colors.ARGB(255, 255,220,115)).Append($"BENVENUTO IN PIZZERIA"$).Append(CRLF).Append(CRLF).PopAll
 cs.Font(Font.CreateFontAwesome(14)).Font(Font.DEFAULT_BOLD).Color(Colors.White).Append($"Inserisci le tue credenziali per accedere oppure
RegistratiLa registrazione dura
meno di un minuto e ci permette di sapere dove consegnare le pizze.
Nel campo ID PIZZERIA inserisci il numero fornito dalla Pizzeria
Grazie per averci scelto."$).Append(CRLF).PopAll
    Label1.AttributedText = cs

Make sure that Label.Multiline is set to true.
 
Upvote 0
Top