I'm trying to make a series of text appear programmatically. It's not quite showing up, and I'm struggling to understand exactly why. Any ideas?
GameObject row = new GameObject("Row");
row.transform.parent = panel.transform;
HorizontalLayoutGroup rowLayoutGroup = row.AddComponent<HorizontalLayoutGroup>();
rowLayoutGroup.childForceExpandHeight = false;
GameObject name = new GameObject("Name");
name.transform.parent = row.transform;
GameObject value = new GameObject("Value");
value.transform.parent = row.transform;
Text nameText = name.AddComponent<Text>();
nameText.text = tup.First;
nameText.alignment = TextAnchor.MiddleRight;
Note that this script is run from a Panel, contained within a Canvas.