简体   繁体   English

Flex:何时创建自定义组件以及何时创建外观?

[英]Flex: when to create a custom component and when to create a skin?

I don't see the difference between both cases. 我看不到这两种情况之间的区别。 It began when I wanted to have some special list (eg with some navigation or title on the top). 从我想拥有一些特殊列表(例如,顶部有一些导航或标题)开始。 But then I didn't know what to do, should I extend List and override some methods, or should I simply create a skin for the existing List component? 但是后来我不知道该怎么办,应该扩展List并重写某些方法,还是只为现有List组件创建外观? thnx n

If you're just looking for visual modifications, you should most likely just skin the component. 如果您只是想进行视觉修改,则很可能只需对组件进行蒙皮。

Creating a custom component, that extends List , or using composition would suggest that you need some additional functionality that List itself do not provide to serve your purpose. 创建一个extends List的自定义组件或使用组合将建议您需要一些List本身不提供的其他功能来满足您的目的。 If the case is the latter, then you should use inheritance or composition. 如果是后者,则应使用继承或组合。

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

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