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: 
mramim
Streaming Star

Fixed width-height Scenegraph Button

I want to populate a button with image coming from API, i've set the minWidth and maxWidth to be "64" but whenever I populate the iconUri with image from server, the button just grows in size. How can I prevent this?

0 Kudos
2 REPLIES 2
RokuJonathanD
Community Moderator
Community Moderator

Re: Fixed width-height Scenegraph Button

Hi @mramim,

Can you provide the XML/BrightScript code for your Button node. 

0 Kudos
mramim
Streaming Star

Re: Fixed width-height Scenegraph Button

Sure, I've a button group that holds multiple buttons with different ids, and they all have a placeholder iconUri and focusedIconUri, my intention is to change these icons with a network Image that I receive from the API(that image is not always 64px)

 

<ButtonGroup>

....

<Button id="id1" minWidth="64" maxWidth="64"
height="64" text=""
focusBitmapUri="pkg:/images/transparent.9.png"
focusFootprintBitmapUri="pkg:/images/transparent.9.png"
iconUri="pkg:/images/2_quality.png"
focusedIconUri="pkg:/images/2_quality.png" />

...

</ButtonGroup>



On the brightscript side of the code, I've a task that loads info from api and then I just try to set the field 

m.btn1.iconUri = m.top.response.apiImage
m.btn1.focusedIconUri = m.top.response.apiImage

 

Let me know if you need any other information.

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.