Node width equal to parent node or UIRoot

I'm trying to set a child node's width equal to the width of the UIRoot. It looks like the UIRoot resizes after the node awake method is called. When this happens I have a larger width on the child node. Is this a bug or am I required to use the ScaleAdapter to fix this?

Thank you!
Has invited:

lijh

Favor from:

You can try to stretch the child node's size in it's Transform panel, just press Alt and Shift keys and click the stretch button at bottom right corner.
 

justinboyd5

Favor from:

Sorry I wasn't clear. I'm trying to do this programatically within the behavior class attached to the child node.

QC-Cindy

Favor from:

Hello, to set Node width equal to UIRoot, you can try the method as below:

1. stretch the child node's size in it's Transform panel, click the stretch button at bottom right corner shown as the picture below,

transform.jpg

 
2. set the Right and Bottom to be 0 both, shown as the picture below,

set.jpg

 
Hope it can do some help.

To reply to a question, please Login or registered