Flex 4.6 - Spark 标签的可见高度
我正在尝试确定在运行时变为多行的 Spark 标签的高度(由于设置了 width
属性),以解决文本溢出的问题。
(对于名为 Title 的 Spark 标签)我尝试过:
Title.measureText(Title.text).height
- 这似乎只返回一行的高度。 (由于屏幕尺寸和字体渲染不同,我事先不知道文本会溢出到多少行...)
Title.height
- 这似乎返回标签的高度size(在运行时重新调整多行文本流之前)
即使在 .text 中填充了不同的文本长度/多行长度,上面的两个属性也返回一个不变的值
是否真的没有办法确定溢出的准确高度火花标签?
诚然,我对 Flex API 不太熟悉,但在浏览了相当长一段时间的手册后,我仍然无法以正确的间距放置此标题标签。任何帮助将不胜感激。
I am trying to determine the height of a Spark label that becomes multiline at runtime (due to width
property being set), to account for text overflow.
(For a spark label named Title) I have tried:
Title.measureText(Title.text).height
- this seems to return only the height of one line. (Due to differing screen-sizes and font rendering, I don't know in advance how many lines the text would overflow to...)
Title.height
- this seems to return the height of the label size (before being re-adjusted at runtime for multiline text flow)
Both properties above return an unchanging value even when different text lengths/multiple lines long are filled in .text
Is there really no way to determine the exact height of an overflow Spark label?
I am admittedly not that familiar with the Flex API but after scouring the manual for quite some time, I am still unable to place this title label with the proper spacing. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 Spark 标签的
resize
事件会很有用。只需尝试这个示例应用程序这可能会帮助您
I think
resize
event of Spark label will be usefull.just try this example application This may Help You
如果我正确理解您的问题,您可以收听
mx.events.FlexEvent.UPDATE_COMPLETE
If I understood your question correctly, you can listen to
mx.events.FlexEvent.UPDATE_COMPLETE