Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jmatt0806
Level 7

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
belltown
Level 7

Re: Line Break in Label Text?

text="Blah blah&#xA;blah blah"
https://github.com/belltown/
0 Kudos
jmatt0806
Level 7

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
Level 7

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