向 Flex UIComponent 添加布局 [英] Add layout to Flex UIComponent

查看:36
本文介绍了向 Flex UIComponent 添加布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何向 Flex UIComponent 添加布局(具体来说是 Horizo​​ntalLayout)?

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

我正在开发一个大型移动应用程序,因此我希望避免使用其他容器(如 HGroups)并使用更轻量级的组件.

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!

推荐答案

你不能也没有必要这样做.

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

你不能,因为只有 Spark 组件是用封装的布局机制设计的.mx 组件不是,您不能为 UIComponent 分配布局.

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.

现在,如果您真的想削减它们,您始终可以创建自己的 Group 副本,其中仅包含您真正需要的属性,但在我看来,这对于几乎(如果有的话)来说会浪费大量时间) 显着增益.

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.

这篇关于向 Flex UIComponent 添加布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆