本文介绍了ActionScript MXML &lt;mx:&gt;与<s:>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来我可以为 使用组件.

Looks like I can use components for both <mx:> or <s:>.

那么,哪个更有优势?

推荐答案

正如其他海报所提到的,spark (s:) 命名空间指的是 Flex 4 引入的新组件,而 halo/mx (mx:) 命名空间指的是较旧的组件.

As other posters have mentioned, the spark (s:) namespace refers to the new components introduced with Flex 4, while the halo/mx (mx:) namespace refers to the older components.

它们可以一起使用,这是必要的,因为所有 mx 组件都没有 Spark 等价物(值得注意的遗漏是 DataGrid、Tree、DividedBox 等.)新 Spark 组件的一些动机包括:形式来自功能,这意味着火花组件非常受皮肤驱动.重量更轻以提高性能(您可以使用 s:Group 来布置组件,而不是 mx:Canvas,因为 s:Group 没有任何视觉特征,如填充或边框.)

They can be used together, which is necessary since there are not spark equivalents for all of the mx components (notable omissions are DataGrid, Tree, DividedBox, among others.) Some of the motivations for the new spark components include: Separation of form from function, which means the spark components are very much skin driven. Lighter weight for performance gains (You can use s:Group for laying out your components rather than mx:Canvas, which is much more efficient since s:Group doesn't have any visual characteristics like fill or border.)

底线:我发现 Spark 组件在性能方面非常高效,但在更改外观/行为方面有点麻烦,因为您需要为它们创建自定义皮肤.此外,它们还有一些需要解决的怪癖(为什么 DropDownLists 不像 mx 版本那样根据内容自动确定它们的宽度?!)由于 halo/mx 组件即将弃用,因此通常尽可能使用 spark 组件的良好做法.

Bottom line: I find the spark components to be very efficient performance-wise but a little fussy for changing appearance/behavior since you need to create custom skins for them. Also, they have a few quirks that still need to be ironed out (why don't DropDownLists automatically determine their width based on content like the mx versions did?!) Since the halo/mx components are on the path to deprecation, it's generally good practice to use the spark components whenever you can.

这篇关于ActionScript MXML &lt;mx:&gt;与<s:>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 19:50