I have a scrollview with thousands of items. To make this work at a reasonable framerate, I only add 50 or so cells and repurpose, refill and move them around the scrollview as items move in and out of view. All in all I only need about twice as many cells as can be in view at once to scroll through thousands of items with great framerate.
But as I keep scrolling and showing and hiding and moving, things go weird. I'm fading visibilities in and out all over the place (due to mouseover, different parts of a cell have different opacities depending on their type, fade out/fade in when I switch categories, etc.) All cells that are not currently needed are moved to a secondary off-screen widget on a different panel and are hidden.
My problem: widgets tend to get stuck at wrong opacity. The inspector displays the correct opacity, but it's displaying something else. If I disable and enable the gameObject in the inspector, everything snaps back to the way it should look.
What can I do in code to make sure a widget that might have been hidden, moved to a different parent and had its opacity changed will refresh and display its current condition properly?
So far I'm calling ParentHasChanged on the widget and panel.Refresh on the panel.