- Home /
Text Background
Hi, I've read the solutions suggested for stretching the image parent according to text children
First, add a VerticalLayoutGroup or HorizontalLayoutGroup to your button, to place multiple items next to each other. Even if it's just one Text element, you should use this.
Now, add a ContentSizeFitter component to your button. It will shrink the button down to the preferred size of it's child (if you select that from the dropdown).
But setting to preferred size stretches the image way beyond where the text ends. When there's no image, the solution works perfectly, any ideas how to fix this?
Comment