我有以下默认的mxml配置。
<s:ViewNavigatorApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="Home"
creationComplete="init()"
>
有可能为firstView有一个条件值吗?
为了实现移动兼容性,我在3种不同的视图中寻找实现我的应用程序的方法。
因此,我想为每个视图创建不同的包。有什么解决办法吗?
发布于 2016-03-30 07:28:44
您可以通过使用ViewNavigator -从MXML中删除firstView并在init()方法中执行类似的操作来手动定义视图:
private function init():void
{
if(something)
{
navigator.pushView(Home);
}
else
{
navigator.pushView(OtherView);
}
}
// pass myData as data to the new view (will be accessible as .data property in the Home view):
navigator.pushView(Home, myData);
// remove the last view from the viewstack:
navigator.popView();
这篇文章也许能帮上忙
https://stackoverflow.com/questions/36299567
复制相似问题