Closed hyunwoo9120 closed 1 year ago
I guess the scroll loop rect calculates content's height inaccurately.
LoopScrollRect relies on calculating item size with LayoutUtility.GetPreferredHeight
or LayoutUtility.GetPreferredWidth
. So after applying the reproducing steps above, the cell height gets 200 here which is correct.
The problem in fact is cell has zero height after disabling Control Child Size
You can use other ways to adjust the real cell size (eg. setting cell prefab's height directly) and it just works.
Oh god I spent lots of time 😂 I finally solved. If I bother you I am sorry. I'd been focusing on solving this problem for over a week.
Even though it's written in the example, I thought that if I use my prefab's size (wxh) directly, I don't need the layout element of prefab.
But when I got the item size by getPreferredHeight at GetSize, it returned incorrect number. So I added the layout element to my prefab and checked preferred width and height, solved this...😂
The scroll doesn't work properly and the next object doesn't appear. (I can see only two objects on the screen, but four objects are created, and when I scroll, all objects in the content are inactive (active: false).)
I use vertical layout group, and it has a padding / spacing value.
I also unchecked the Content Size Fitter to solve this problem.