Flex 4 自定义类创建和换肤的标准实践?

发布于 2024-12-14 13:56:21 字数 256 浏览 1 评论 0原文

我正在创建一个基本应用程序,其中包含顶部导航按钮栏、底部按钮栏和中间内容的视图堆栈。问题在于内容,而且皮肤是完全动态的,基于我正在加载的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱你是孤单的心事 2024-12-21 13:56:21

我找不到任何教程,所以我想我会像在 Flex 3 中一样动态创建我的组件,唯一的区别是,如果我有一个组件,我需要皮肤,在我的例子中是一个按钮,我正在创建我会动态地使用它:

btn_nav.setStyle("skinClass",skins.NavMainToggleButtonSkin); 

主机组件在哪里:[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 :

btn_nav.setStyle("skinClass",skins.NavMainToggleButtonSkin); 

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文