当您单击 Flex Mobile 应用程序中的 ViewNavigator 时,会触发哪个事件?

发布于 2024-11-30 06:47:23 字数 441 浏览 3 评论 0原文

<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 技术交流群。

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

发布评论

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

评论(3

本王不退位尔等都是臣 2024-12-07 06:47:23

这可能对您有帮助:
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.

靖瑶 2024-12-07 06:47:23

如果您想在视图导航器上监听事件,我发现这些往往可以工作:

elementAdd="mainNavigator_elementAddHandler(event)"
elementRemove="mainNavigator_elementAddHandler(event)"

在本例中,我的视图导航器称为“mainNavigator”。我也这样做过:

ChangeWatcher.watch(mainNavigator,'length', mainNavigator_lengthChangeHandler, false, true);

但我不知道这是否那么干净。

If you want to listen on the view navigator for events, I've found these tend to work:

elementAdd="mainNavigator_elementAddHandler(event)"
elementRemove="mainNavigator_elementAddHandler(event)"

In this case my view navigator is called 'mainNavigator'. I've also done this:

ChangeWatcher.watch(mainNavigator,'length', mainNavigator_lengthChangeHandler, false, true);

But I don't know if that's quite as clean.

回眸一遍 2024-12-07 06:47:23

@达夫兹,
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)

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