Flex 4:UIComponent 的父属性和所有者属性
我试图理解 UIComponent 的所有者属性和父属性之间的区别。
<s:Panel id="panOne" title="Success">
<s:Label id="labOne" text="Hello World!!"/>
</s:Panel>
在上面的代码中,labOne.owner.id 返回panOne,labOne.parent.id 返回contentGroup。
我理解所有者属性是指组件的父容器(在本例中为标签)。但父财产到底意味着什么呢?我认为它与一些具有 contentGroup id 值的皮肤概念有关。
有人可以给出这两者之间的确切区别吗?
谢谢杰森。您提供的链接中还有另一个链接。这两个词解释的非常清楚。该链接是:Gumbo DOM Tree API - 功能和设计规范
我已将该页面中的最佳行粘贴到下面。
视觉元素的父级是直接负责布局它的容器。视觉元素的所有者是逻辑上拥有它的组件。如果 Button 位于 SkinnableContainer 中,则其父级是 contentGroup,而其所有者是 SkinnableContainer。
I'm trying to understand the difference between the owner and parent properties of the UIComponent.
<s:Panel id="panOne" title="Success">
<s:Label id="labOne" text="Hello World!!"/>
</s:Panel>
In the above code, labOne.owner.id returns panOne and labOne.parent.id returns contentGroup.
I understand the owner property refers to the parent container of a component (Label in this case). But what does parent property actually mean? I think it relates to some skin concept which has a with id value of contentGroup.
Could someone give exact difference between these two?
Thanks Jason. There is another link in the link provided by you. It explained these two terms very clearly. That link is: Gumbo DOM Tree API - Functional and Design Specification
I have pasted below the best lines from that page.
The parent of a visual element is the container directly in charge of laying it out. The owner of a visual element is the component that logically owns it. If a Button is in a SkinnableContainer, its parent is the contentGroup while its owner is the SkinnableContainer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flexponential 有一篇漂亮的文章解释了父母和所有者之间的差异。
Flexponential has a pretty article explaining the differences between parent and owner.