I've tried and tried to do this on my own, but I've failed miserably, so I'm back to the forums feeling like things either don't work right in my brain, or in NGUI.
I have a UITable. It gets filled with stuff. I want to insert a new object into the next-to-last position. When I do this, the object always shows up in the last position, unless I leave/return to the table which involves disabling/enabling the gameobjects.
int index = m_tblCharSelectTable.children.Count - 1;
GameObject child = NGUITools.AddChild(m_tblCharSelectTable.gameObject, m_btnCharSelectNew.gameObject);
mTable.children.Insert(index, child.transform);
mTable.repositionNow = true;
//NGUITools.MarkParentAsChanged(mTable.gameObject);
It doesn't really matter where I try to put the index if I recall, it always adds it at the last object until I disable/enable the panel. I'll have to investigate that more, but it doesn't matter if I mark parent as changed, repositionNow, reposition(), whatever... it's always adding it to the last index.
So I must be doing this wrong. Advice on how to do this correctly please?