I am attaching objects with UIDragPanelContents components to a UIGrid during run time. The UIGrid is a child of a UIDraggablePanel. The UIDraggablePanel has a clipping area set to 'hard clip'.
The UIDragPanelContents widgets are all disappearing from view when the panel is at rest (i.e. not being dragged). When I drag the contents down a bit (thereby exposing the blank area above the top of the list), the items suddenly appear. But when I release the drag and the items spring back into place, they disappear again. (Please see attached screenshots).
If I drag the contents upward so I can see the lower items in the list, the list items remain completely invisible. It is as if the entire list is being clipped out, even though only one or two list items are hitting the upper bound of the clipping area.
Any idea why this may be happening?
I believe I am setting up the list items properly:
var masterDragPanel = this.transform.GetComponent<UIDraggablePanel>();
masterDragPanel.ResetPosition();
var itemHistoryList = ItemLog.Entries;
foreach( var entry in itemHistoryList )
{
var newHistoryItemObj = NGUITools.AddChild( itemHistoryGrid.gameObject, historyItemPrefab );
var dragPanelContents = newHistoryItemObj.GetComponent<UIDragPanelContents>();
dragPanelContents.draggablePanel = masterDragPanel;
}
itemHistoryGrid.Reposition();
masterDragPanel.UpdateScrollbars( true );
masterDragPanel.ResetPosition();