LayoutRebuilder.ForceRebuildLayoutImmediate doesn't work correctly in nested layout.,LayoutRebuilder does not work in Nested Complex Layout

source code of UGUI, it seems like it can fit in nested layout.
[179100-qq截图20210412174341.png|179100]

However,it doesn’t work when I call the function “LayoutRebuilder.ForceRebuildLayoutImmediate” once at the root node. I have to call this function multiple times like that when I met nested layout. (from bottom to top, child to parent)


Does anyone know why the source code doesn’t work well as I expected and what I can do to deal with the problem properly.

Hey mate, unfortunately, your snippets seem like very bad practice

I haven’t figured out how to solve this myself, but it just doesn’t seem fit to force so many layout resets. What I have found, though, is that usually, it has to do with the layout in your hierarchy. For example, a text placeholder that will adjust its size, that is inside another placeholder that will adjust its size too. In this case, I just had to have two layout resets, as the first will affect the inner placeholder (the one that holds the text), whilst the second will affect the second (the one that holds the placeholder)

I would love to see some answer to this issue as well :slight_smile: