Hello there,
I’ve looked around to try and understand the use of Content Size Fitter and Layout Groups, in order to resize a parent to adapt to the child Text content.
I think I’ve got the gist of it, but there’s an issue I’ve encountered, and the Unity help seems to not mention it at all:
If you put a Content Size Fitter and Vertical Layout Group on your Image (as stated by unity docs), this actually does not resize your image. It seems the Image’s layout information (preferred size) takes priority on Vertical Layout Group.
But this does work using RawImage, instead of Image.
I wondered if I was missing something here. Would there be a way to remove the Image’s layout information? So that Layout Group information can take priority?
I tried re-ordering the components, but it didn’t do anything.
The reason I wish to use Image instead of RawImage, is I’d like to mirror the image without affecting the child Text. I can do this easily with a sprite (Image), but not with a texture (RawImage).
I’d appreciate any help. Thanks!