Hello, I was trying the new UI at Android but found the best way to make it stretch correctly was setting the anchors exactly at the same size of the button.
Found out it was too hard to exactly place the anchor at the same size (position) of the button corners because it does not snap to corners\edges and if it is placed a little bit wrong the sizes gonna be different from other elements making it unaligned.
Using the Rect transform anchor presets the anchors always goes to Button parent size (a panel) which is not correctly set when stretching
Like this following image:
When stretched it looks like this
And when correctly set and the corners the stretching is correct because it also move the button up as stretch it like this:
There are any way to make the anchor snap to the button or any other element (it’s own) because it is really hard to exactly match it… or something automatically? (maybe I’m doing it all wrong?)
PS: While making this question I noticed I could make the anchor as the button and then snap the button to the anchor because this method it snap correctly and then I could hold shift while move the anchor to resize the button with it (but using values would not work)
I was also trying to anchor buttons to the screen, I didn’t need to use this script. I just created an empty image and then parent my buttons under the image and used the anchor of the image. Worked fine