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: 
simranjit
Binge Watcher

How to get the current width of Label ?

I have create the Label in XML. 

<Label
  id="testLabel"
  font="font:MediumBoldSystemFont"
  text = "Application Development Made Easy!"
  horizAlign = "left"
  vertAlign = "center"
  translation="[10,10]" />

How to get the width of label during run time, if text of this label is changed randomly.
Thanks.
0 Kudos
1 REPLY 1

Re: How to get the current width of Label ?

You can use the ifSGNodeBoundingRect functions on the label: https://sdkdocs.roku.com/display/sdkdoc/ifSGNodeBoundingRect
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.