Unity3D Automatic Layout Components Need a Refresh


Sometimes, with dynamic content, the automatic layout components such as the Content Size Fitter and Vertical/Horizontal Layout Group don't seem to work right. See the issue on Unity Forums here.

The solution to this as pointed out on the forum is to call the following after an item-update:

LayoutRebuilder.ForceRebuildLayoutImmediate(_rectTransform);

Comments