【问题标题】:Is there a way to notice the skin class of a Spark Button that his width have been modified?有没有办法注意到他的宽度已被修改的 Spark Button 的皮肤类?
【发布时间】:2011-07-15 22:44:28
【问题描述】:
我在外部调整 spark 按钮组件的大小,但在内部如果我有一个 Rect 对象和一些 Path,可以通过将它们设置为 100% 宽度来调整其大小。
但如果路径很多或使用简单的 swf 资产,则不再工作。
第一次显示组件时可以正确设置宽度。但是之后,我无法更改它。
我正在寻找 Spark 架构中的方法或处理程序,它可以接收皮肤类中的更改,因此我可以调整我的类中的所有视觉元素。
【问题讨论】:
标签:
flex4
components
flash-builder
flex-spark
【解决方案1】:
只要使用updateDisplayList方法就可以了
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
trace("unscaledWidth"+unscaledWidth);
}