【Unity3D】How to arrange the positions of UI buttons in the corners

I added a button in the upper left corner, but it is no longer in the upper left corner after maximizing.
How can I keep the button in the corner of the interface? It’s super easy to solve!

Insert image description here
Directly select the button and click the Achor Presets in the upper left corner of RectTransform in the Inspector on the right. There are many options to choose from. Just select the corresponding position in which corner you want the component to be located.

Insert image description here
It represents the relative distance of the component's relative interface anchor.

When we use Unity's UGUI to design a game UI, we have to consider the scaling and position adaptation of the UI on machines with different resolutions. For more details, you can read this blogger's article, which explains various aspects of this issue in detail: Unity Basics: Make the UI adapt to changes in screen resolution.

Guess you like

Origin blog.csdn.net/weixin_41932970/article/details/130315627