Flex RichText 与标签控件
我有一个 Flex 项目,在其中广泛使用 Spark RichText 控件,在某些地方我可以用 Label 控件替换 RichText -(富文本是由于从 Flash Catalyst 导入而发生的)。
我的问题是,使用 Label 相对于 RichText 是否有任何空间/性能优势,因为 Label 似乎是一个更轻的选项,我正在构建一个 Web 应用程序,大小很重要。
谢谢。
I have a flex project where I uses the spark RichText control quite extensively, there are places where it is possible for me to replace RichText with the Label control - (The rich text occurred due an import from Flash Catalyst).
My question is, is there any space/performance advantage in using Label over RichText, since Label seems like a much lighter option, I am building a web app, size matters.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除非您的文本需要以下功能之一:
使用简单的标签,它确实比 RichText 更轻。我不知道你最终会节省多少大小和内存,但这样做不会有什么坏处。
Unless you need one of these features for your text :
Go with a simple Label, it's indeed lighter than the RichText. I don't know how much size and memory you will save at the end but it won't hurt doing it.
当然,
Label
比RichText
具有更好的性能和内存使用率。而Label
是简单标签的最佳选择。应用程序大小取决于您的项目设置。如果您使用 RSL(这是 Flash Builder 中 Flex 4 项目的默认选项),那么您使用什么组件并不重要。
Of course
Label
has better performance and memory usage thanRichText
. AndLabel
is the best option for simple labels.What about application size it depends on your project's settings. If you're using RSLs (which is default option for Flex 4 projects in Flash Builder) it doesn't matter what component do you using.
来自 Adobe...
RichText 使用文本布局框架 (TLF) 库,该库又构建于 Flash Player 10 中的 Flash 文本引擎 (FTE) 之上。两者结合起来,使用高质量的国际版式提供富文本布局。
Spark 架构提供了三种文本“原语”——Label、RichText 和 RichEditableText。 Label 是最快、最轻量级的,因为它仅使用 FTE,而不是 TLF,但它的功能有限:没有富文本、没有滚动、没有选择和编辑。 RichText 添加了显示具有复杂布局的富文本的功能,但仍然是完全非交互式的。
From Adobe...
RichText uses the Text Layout Framework (TLF) library, which in turn builds on the Flash Text Engine (FTE) in Flash Player 10. In combination, they provide rich text layout using high-quality international typography.
The Spark architecture provides three text "primitives" -- Label, RichText, and RichEditableText. Label is the fastest and most lightweight because it uses only FTE, not TLF, but it is limited in its capabilities: no rich text, no scrolling, no selection, and no editing. RichText adds the ability to display rich text with complex layout, but is still completely non-interactive.