开发者

in Flex, how to add child as first child?

开发者 https://www.devze.com 2023-01-09 00:58 出处:网络
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 instea

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);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号