i have managed to get scrollview, grid and adding children to it to work fine. i have one problem though and that is modifing the child after it was added to the grid. here is the code i have currently (script attached to the button for adding children):
public GameObject Grid;
public GameObject Prefab; //button with backgroun and label
void OnClick()
{
Prefab.gameObject.name = Random.Range(0,100).ToString(); // just test to see if i can change the name before it is added to the grid - works!
NGUITools.AddChild(Grid,Prefab).GetComponent<UILabel>().text = Random.Range(0,100).ToString(); //this does not work? i need to modify the label text so that i can get something meaningfull
Grid.GetComponent<UIGrid>().repositionNow = true;
}
thanks!