Add layout to Flex UIComponent

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 20:14:15

问题


How can I add a layout (a HorizontalLayout to be specific) to a Flex UIComponent?

I'm working on a large mobile application, hence I'd like to avoid using additional containers like HGroups and work with more lightweight components.

As usual, any help would be greatly appreciated!


回答1:


You can't and you don't really need to.

You can't, because only Spark components were designed with an encapsulated layout mechanism. mx components were not and you can't assign a layout to UIComponent.

You don't really need to, because Groups were already designed to be very lightweight containers without any graphical elements in them. Their only purpose is to layout other components.

Now if you really want to trim them down, you can always create your own copy of Group that contains only the properties you really need, but in my opinion that would be a huge time-waster for a barely (if at all) noticeable gain.



来源:https://stackoverflow.com/questions/11309683/add-layout-to-flex-uicomponent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!