强制刷新 Titanium (iPhone) 导航组窗口
我正在使用 Appceleartor Titanium 引擎为 iPhone 开发数据驱动的应用程序。
简而言之,我有一个带有名字变量(标签)的窗口和一个按钮。 单击该按钮,它会将您带到第二个窗口(通过导航组)。在第二个窗口中,您可以更改 first_name 变量。
所以问题是,当用户单击“后退”按钮返回到导航组中的第一个窗口时,如何反映first_name变量的变化?
(first_name变量只是一个抽象,实际的数据变化实际上要大得多,而且通常不是一个又一个窗口,而是可以深入到4、5个不同的窗口)
I am developing a data-driven application for iPhone using Appceleartor Titanium engine.
To cut it short, I have one window with first_name variable (label) on it and a button.
You click on the button, it bring you to the second window (through navigation group). ANd in this second window you can change the first_name variable.
So the question is, as the user click "Back" Button to go back to the first window in the navigation group, how do I reflect the first_name variable change?
(The first_name variable is just an abstract, the actual data change is actually a lot bigger, and it usually is not one window after another but could drill down to 4, 5 different windows)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事件监听器。在第一个窗口中添加类似的内容
,然后在第二个窗口中触发事件
eventListener. add in the first window something like
and in the second window fire the event
您可以在标签上放置一个事件侦听器,并在内容发生更改时触发更新。
您可以为标签创建一个更新方法,并将其放置在 gloval 命名空间中,使其可以从其他窗口调用。
You can put an event listener on the label and fire an update when the contents should he changed.
You can create an update method for the label and place it in the gloval namespace making it available to he called from the othe window.