Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: nguiman on April 29, 2014, 12:26:36 AM
-
I have a UIPanel/UIScrollview (w/Alpha Clipping), and a UIGrid under that with a number of UIDragScrollViews as children. The children are instantiated once, the details and active state are enabled/disabled in place at runtime (meaning they are not destroyed just disabled).
I've noticed when going from a long list to a short list, the overall size of the grid doesn't change resulting in the shorter list potentially being shown offscreen. For example...
I instantiate a list of 15 items. All 15 are active, the containing UIPanel is using 'Alpha Clipping' to show 5 items at a time. I scroll to the bottom. I then load up a list of 3 items by replacing the values of the first 3 items and making the remaining 12 inactive. The 3 items and collider are now inaccessible outside the clipping region.
translating the UIPanel/Scrollview Transform relocates the Grid, but breaks the clipping region as that moves as well.
How can I reset the position of the panel/scrollview for the shorter list?
also I'm using NGUI v3.0.7f2, but can't upgrade due to other dependencies.
-
You need to ResetPosition() on the UIScrollView. However this advice is for the current version of NGUI. 3.0.7 is very old.
-
Thanks!