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

Newline in Label Node

Hi,

Really sorry for the basic question, but I've searched and can't find the answer. Does anyone know how to add new lines to the Label component. E.g.


     <Label 
              id = "bodyLabel" 
              width = "1000"
              height = "1000"
              text = "test  \n new line" 
              wrap = "true"
              horizAlign = "left" />        


 
I know in code it would be Chr(10) but don't know how to add this direct to strings in XML.

Thanks,

Ryan
0 Kudos
2 Replies
Highlighted
monkeysource
Level 7

Re: Newline in Label Node

I've found the solution, kinda obvious when you know how. For other users it's

&#10;

E.g


<Label 
              id = "bodyLabel" 
              width = "1000"
              height = "1000"
              text = "test  &#10; new line" 
              wrap = "true"
              horizAlign = "left" />    
0 Kudos
EnTerr
Level 9

Re: Newline in Label Node

Thanks for sharing!
I would have thought it's as simple as literally embedding the new line:
     <Label text = "test  
new line" 
              wrap = "true"
              horizAlign = "left" />

But no - not with XML. It's true that you can include new lines in attribute values. But what's also true apparently is that there is mandate to normalize[/url:j69i4sxg] these, in which new lines and tabs would get converted to spaces...









0 Kudos