Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to create a simple UI, but my elements won't keep their position and size. Every time I run the app, I see something different from what I can see in the editor.

Editor:

Planned out UI

App:

What I see, when I run. The sizes and positions are for some reason reset

question from:https://stackoverflow.com/questions/65903039/gui-elements-wont-keep-size-and-position

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

This is likely because you're transforming controls placed inside Containers. You should never move nodes placed in containers manually, except for animation purposes at run-time.

To place nodes correctly when using containers, look into setting the size flags (fill, expand, or both) and perhaps use more nested containers.

This pull request will make this limitation more clear once it's merged.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...