I am开发者_如何学运维 adding child as:
containerComponent.addChild(newComponent);
But, it adds it as last child. How can I add newComponent as first child of containerComponent?
Use addChildAt instead of addChild with the index parameter set to 0:
containerComponent.addChildAt(newComponent, 0);
containerComponent.addChildAt(0, newComponent);
精彩评论