简体   繁体   English

Flex 4外观-何时包含Actionscript样式代码?

[英]Flex 4 skins — when to include Actionscript Styling Code?

When using Flash Builder to create a new component Skin based on an existing Skin, one has the option to include Actionscript styling code or not. 使用Flash Builder根据现有外观创建新组件外观时,可以选择是否包含Actionscript样式代码。 Wouldn't this code always be necessary? 不一定总是需要此代码吗?

Here is an example of two people, both of whom have skinned the spark Panel. 这是两个人的示例,两个人都为Spark Panel蒙皮。

With styling code: 使用样式代码:

http://blog.flexexamples.com/2009/10/19/repositioning-the-control-bar-on-a-spark-panel-container-in-flex-4/ http://blog.flexexamples.com/2009/10/19/repositioning-the-control-bar-on-a-spark-panel-container-in-flex-4/

Without styling code: 没有样式代码:

http://www.popamihai.com/2010/11/flex/skinning-flex-4-components-skinning-the-spark-panel-component/ http://www.popamihai.com/2010/11/flex/skinning-flex-4-components-skinning-the-spark-panel-component/

But they both seem to run fine. 但是它们似乎都运行良好。 How can this be? 怎么会这样?

The styling code still gets applied due to the fact that you're extending a class. 由于您正在扩展类,因此样式代码仍然适用。

You should add the styling code when you intend to change it. 打算更改样式代码时,应添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM