I’m developing a simple tooltip component. The structure is as follows…
-
Panel - Image, ContentSizeFitter, HorizontalLayoutGroup
-
TMP Text
Here are the panel settings…
The panel properly resizes horizontally as the text length increases.
The problem I’m having is that the ContentSizeFitter appears to be forcing the panel’s initial width to 128 pixels. The panel does get wider when the text is greater than 128 pixels, but it doesn’t scale down to fit shorter text.
When I set “Horizontal Fit” to “Unconstrained”, set the width to 30, and then set “Horizontal Fit” to “Preferred Size” again the panel size is set back to 128.
I need the panel size to be smaller initially. Any suggestions?