Fitting the Parent RectTransform to the child contentsize?

hi,
i want to realize a tooltipp system and for that i want to have a simple Panel with a background image and a child Text Component. Now i want to pass some text to the ShowTooltip(). The Parent(the background image) has to shrink and grow depending of the textlength/size of the child.

How can i do that? I read something about the contentSizeFitter but it does not fit the parent to its size right? Or am i doing something wrong here? I tried to size the parent with the .sizeDelta but since the child has the contentSizeFitter on it the height is always 0 :frowning:

Would be very happy if someone would help me
thanks

hmm … i tried every variable offered by RectTransform but none of them gave the the actual height of my Text (see image attached) … the inspector knows the height but its greyed out and the log returns everywhere 0 :frowning:

Can’t be true that it is impossible to get this damn value -.-’