Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jmatt0806
Channel Surfer

Line Break in Label Text?

Is there a simple way to add a line break in the Label text?


    <Label
      id="Details"
      height="300"
      width="1300"
      font="font:MediumBoldSystemFont"
      text="Blah blah blah blah"
      wrap="true"
      translation="[300,600]" />
0 Kudos
4 REPLIES 4
belltown
Roku Guru

Re: Line Break in Label Text?

text="Blah blah&#xA;blah blah"
0 Kudos
jmatt0806
Channel Surfer

Re: Line Break in Label Text?

"belltown" wrote:
text="Blah blah&#xA;blah blah"


Thanks very much...this worked.
0 Kudos

Re: Line Break in Label Text?

I used the global string function
 chr(10)

as noted here: https://sdkdocs.roku.com/display/sdkdoc/Dialog

Example:
label.text = "first line" + chr(10) + "second line"
0 Kudos
norcaljohnny
Roku Guru

Re: Line Break in Label Text?

"lukechinworth" wrote:
I used the global string function
 chr(10)

as noted here: https://sdkdocs.roku.com/display/sdkdoc/Dialog

Example:
label.text = "first line" + chr(10) + "second line"


This works well if the content is already rendered but if its a let's say roUrlTransfer via xml file then belltown is correct.

I use the 
&#xA;


when importing lyrics in xml format.
0 Kudos