如何获取 Flex Accordion 子项的大小?
我正在计算嵌入在基于 Canvas 的组件中的图像的 maxHeight,该组件是基于 Canvas 的组件的一部分,而该组件是 Accordion 的子组件。
我需要获取当前选定的子容器可用的实际像素数。 奇怪的是,measuredHeight 和 getExplicitOrMeasuredHeight() 给出了我用作 Accordion 子容器的 Canvas 的设计时大小。 不是基于 height="100%"
或 top="10" Bottom="10"
的运行时大小。
我预计手风琴的子项的大小将根据手风琴的客户区域进行调整,这将使我的代码能够计算出图像的大小,而不会引起滚动条。 我已经浏览了 Accordion.as 源代码,但没有什么让我惊讶的。 我即将对 Accordion 进行子类化,只是为了使受保护的函数 get contentHeight():Number 成为公共函数。
有任何想法吗?
I am calculating the maxHeight of an Image embedded in a Canvas-based component that is part of a Canvas-based component that is the child of an Accordion.
I need to get the actual number of pixels available to the currently selected child Container. Oddly enough, measuredHeight and getExplicitOrMeasuredHeight() give the design-time size of the Canvas I used as an Accordion's child Container. not the run-time size based on height="100%"
or top="10" bottom="10"
.
I expected that the Accordion's children will be sized to the client area of the Accordion and that would allow my code to figure out how large the Image could be without inducing scroll bars. I've walked through the Accordion.as source, but nothing jumps out at me. I'm about to sub-class Accordion just to make protected function get contentHeight():Number
a public function.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这会有所帮助:
以及可选的+边框宽度。
Maybe this will help:
and optionally + border widths.