Flex 4 自定义类创建和换肤的标准实践?
我正在创建一个基本应用程序,其中包含顶部导航按钮栏、底部按钮栏和中间内容的视图堆栈。问题在于内容,而且皮肤是完全动态的,基于我正在加载的 XML。因此,我必须动态创建 ViewStack(因为我不知道它可以有多少个子视图),顶部和底部导航按钮栏也是如此。现在,我可以使用 Flex 3 非常巧妙地处理这个问题,但是我想使用 Flex 4 来做到这一点,并且希望利用其新的逻辑和换肤分离架构。我已经看过很多关于编译时已知组件的教程,但没有看到关于自定义类创建的教程。谁能列出一些好的教程吗?谢谢-迈克
I have a basic app I'm creating with a Top Nav button Bar a bottom button Bar and a Viewstack for content in the middle. The catch is the content, and skins are completely dynamic based on XML I'm loading. Therefore I have to create the ViewStack dynamically (because I don't know how many children it could have) and the same goes for the top and bottom Nav button bars. Now, I could handle this very neatly with Flex 3 , however I want to to do this with Flex 4 and would like to take advantage of its new logic and skinning separation architecture. I have seen many tutorials on this as far as components known at compile time but not for custom class creation. Can anyone list some good tutorials? thx - Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找不到任何教程,所以我想我会像在 Flex 3 中一样动态创建我的组件,唯一的区别是,如果我有一个组件,我需要皮肤,在我的例子中是一个按钮,我正在创建我会动态地使用它:
主机组件在哪里:[HostComponent(“spark.components.ToggleButton”)]
我还使用开发人员编写的自定义Spark Viewstack:
spark Viewstack
另外这篇文章还帮助我创建了一个自定义组件并连接皮肤类以及它与组件生命周期的关系:
http://flexguruin.wordpress.com/2010/12/08/flex-4-spark-component-life-cycle/
-迈克
I could not find any tutorials , so I figured I would create my components dynamically as I would in Flex 3, the only difference would be that if I have a component I need to skin, in my case a button, and I'm creating it dynamically I would use :
Where the host component is : [HostComponent("spark.components.ToggleButton")]
I also am using custom Spark Viewstack that a developer wrote:
spark Viewstack
Also this article helped me with creating a custom component and connecting wih a skin class and how it relates to the component lifecycle:
http://flexguruin.wordpress.com/2010/12/08/flex-4-spark-component-life-cycle/
-Mike