Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: AlexSudnikov on November 03, 2014, 07:25:18 AM

Title: // UIGrid leaves gaps after reposition //
Post by: AlexSudnikov on November 03, 2014, 07:25:18 AM
Hi there ,

Well the thing is that i've got a scrollable panel implemented via UIScrollView and UIGrid. I also have a script adding instantiated elements ( buttons ) to the grid. Before adding new set of elements i remove current elements with UIGrid::RemoveChild method and then destroy removed elements. Once new elements are added , i call UIGrid::Reposition method.
The problem is that there are weird gaps left in grid once new elements are added...
Any tips are greatly appreciated.

Thanks!^^
Title: Re: // UIGrid leaves gaps after reposition //
Post by: ArenMook on November 04, 2014, 09:14:14 AM
You need to use NGUITools.Destroy to remove items. Otherwise they are still here. Unity doesn't remove items until the end of the frame.
Title: Re: // UIGrid leaves gaps after reposition //
Post by: AlexSudnikov on November 05, 2014, 08:33:53 AM
Thanks!