Vertical Layout Does Not Resize Properly

Hello, I have a very strange problem. I have a vertical layout, which has 3 vertical layouts as children. I add elements dynamiacally to each of the 3 layouts. In this case, I only add to the first of the children. What happens is that the NPCInfoLayout does not resize properly when I add items to it initially (

). I cannot add a Content Size Fitter to the children layouts and adding Content Size Fitter to the Scroll component breaks everything. I have been stuck on this for about a week already and I would welcome any suggestions to fix this.

Thank you in advance!

@unity_67F79EB7C9F2263B68B2 try to call LayoutRebuilder.forceRebuildLayout(rect) and replace the “rect” with the parent layout gameobjects rectTransform component. Call this everytime when you change the content of the layouts.