TabNavigator 不显示子项
我有一个 TabNavigator 组件,在运行时添加子组件时不显示其子组件。
请问有办法解决这个问题吗?
我现在正在做以下事情:
var tabNavigator:TabNavigator = new TabNavigator();
// etc.
parentHBoxContainer.addChild(tabNavigator);
// etc.
// Custom component with nothing special in it
// Trigger on a button click (Add)
var myComponent:MyComponent = new MyComponent();
var nextTabIndex:int = tabNavigator.getChildren().length;
tabNavigator.addChild(myComponent);
// I see some text flashing but the current tab stays the same
// No text is added
tabNavigator.validateNow();
tabNavigator.selectedIndex = nextTabIndex;
抱歉大家没有提供足够的细节。 tabNavigator 位于 HBox 容器内,我没有添加代码,因为我认为它是无关紧要的。
我在上面的代码中将 SimpleComponent 替换为 MyComponent。 MyComponent 只是另一个带有文本字段和标签的 HBox。
谢谢。
I have a TabNavigator component which is not showing its children when adding them at runtime.
Is there a way around this please?
I'm doing the following at the moment:
var tabNavigator:TabNavigator = new TabNavigator();
// etc.
parentHBoxContainer.addChild(tabNavigator);
// etc.
// Custom component with nothing special in it
// Trigger on a button click (Add)
var myComponent:MyComponent = new MyComponent();
var nextTabIndex:int = tabNavigator.getChildren().length;
tabNavigator.addChild(myComponent);
// I see some text flashing but the current tab stays the same
// No text is added
tabNavigator.validateNow();
tabNavigator.selectedIndex = nextTabIndex;
Sorry guys for not giving enough details. The tabNavigator is inside an HBox container, I didn't add the code because I thought it would be irrelevant.
I replaced SimpleComponent by MyComponent in the code above. MyComponent is just another HBox with a textfield and a label.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试把这个:
而不是这个:
Try to put this:
instead of this: