[译] 在Spark的容器组件中使用Halo(mx)的导航组件
我很喜欢使用mx的导航组件:如ViewStack, TabNavigator等,然而当我们将这些导航组件添加到spark的容器中的时候会出现以下错误提示:
The children of Halo navigators must implement INavigatorContent.
解决的办法有以下两种:
1.自己去封装新的spark容器
2.使用spark的NavigatorContent组件( NavigatorContent 扩展了spark的SkinnableContainer ,所以你可以把它当成组或者自定义布局来使用)。
- <?xml version=”1.0″ encoding=”utf-8″?>
- <s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
- xmlns:s=”library://ns.adobe.com/flex/spark”
- xmlns:mx=”library://ns.adobe.com/flex/mx”
- minWidth=”955″ minHeight=”600″>
- <s:layout>
- <s:VerticalLayout/>
- </s:layout>
- <mx:ViewStack id=”vs” width=”400″ height=”200″>
- <s:NavigatorContent width=”100%” height=”100%” backgroundColor=”0xFF0000″>
- <s:layout>
- <s:VerticalLayout/>
- </s:layout>
- <s:Button label=”vertical button 1″/>
- <s:Button label=”vertical button 2″/>
- <s:Button label=”vertical button 3″/>
- </s:NavigatorContent>
- <s:NavigatorContent width=”100%” height=”100%” backgroundColor=”0×0000FF”>
- <s:layout>
- <s:HorizontalLayout/>
- </s:layout>
- <s:Button label=”horizontal button 1″/>
- <s:Button label=”horizontal button 2″/>
- <s:Button label=”horizontal button 3″/>
- </s:NavigatorContent>
- </mx:ViewStack>
- <mx:ToggleButtonBar dataProvider=”{vs}”/>
- </s:Application>
