当您单击 Flex Mobile 应用程序中的 ViewNavigator 时,会触发哪个事件?
<s:ViewNavigator id="trends" label="Trends" width="100%" height="100%" firstView="views.TrendsView" icon="@Embed('assets/column-chart-icon32.png')"/>
<s:ViewNavigator id="attach" label="Attach" width="100%" height="100%" firstView="views.AttachView" icon="@Embed('assets/paperclip-icon32.png')"/>
现在,我知道如果您单击“趋势”,则会显示第一个视图“views.TrendsView”。 现在您在该视图中并再次单击“趋势”(底部导航栏),哪个事件将灵活调度?
<s:ViewNavigator id="trends" label="Trends" width="100%" height="100%" firstView="views.TrendsView" icon="@Embed('assets/column-chart-icon32.png')"/>
<s:ViewNavigator id="attach" label="Attach" width="100%" height="100%" firstView="views.AttachView" icon="@Embed('assets/paperclip-icon32.png')"/>
Now, I know if you click on "trends" then firstView "views.TrendsView" will be shown.
Now you are in that view and click again on "trends" (bottom nav bar) which event will flex dispatch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能对您有帮助:
http://opensource.adobe.com/wiki/display/flexsdk/View +and+ViewNavigator
根据本文档,当再次单击“trends”时,您的类“views.TrendsView”应调度 ViewNavigatorEvent.VIEW_ACTIVATE 类型的事件。
This might help you:
http://opensource.adobe.com/wiki/display/flexsdk/View+and+ViewNavigator
According to this document, your class "views.TrendsView" should dispatch an event of type ViewNavigatorEvent.VIEW_ACTIVATE when "trends" is clicked again.
如果您想在视图导航器上监听事件,我发现这些往往可以工作:
在本例中,我的视图导航器称为“mainNavigator”。我也这样做过:
但我不知道这是否那么干净。
If you want to listen on the view navigator for events, I've found these tend to work:
In this case my view navigator is called 'mainNavigator'. I've also done this:
But I don't know if that's quite as clean.
@达夫兹,
viewActivate 仅调度一次,即第一次单击“趋势”时。一旦您进入“趋势”并再次单击,它就不会触发 viewActivate 事件,因为该视图已激活。我认为 Flex 不会在活动视图上触发任何事件,即“趋势”选项卡处于活动状态,并且您再次单击底部导航栏上的“趋势”(在 TabViewNavigatorApplication 中)
@Davz,
viewActivate dispatch only once i.e. first time you click on "Trends". Once you are in "Trends" and click again it will not fire viewActivate event since that view is activate one. I think flex don't fire any event on active view i.e. "trends" tab is active and you click again on "trends" on bottom navigation bar (in TabViewNavigatorApplication)