现在的位置: 首页 > 综合 > 正文

解决Sencha Touch 2 NavigatorView Push事件只触发了一次问题

2013年12月01日 ⁄ 综合 ⁄ 共 515字 ⁄ 字号 评论关闭

大家在使用NavigatorView的时候是不是只能切换一次页面,第二次返回的时候,不能切换了。。。。

实际上这是sencha的一个不人性的设置,因为当我们返回的时候,实际上对旧有页面调用了一个pop()事件,而pop事件实际上会将你旧有的页面destory,然后重新生成一个页面,这样你原来监听的那些事件就都无效了。。。。。。。

大家只要将navigaotrView的autoDestory配置项设置为false即可。

论坛管理员解释:

http://www.sencha.com/forum/archive/index.php/t-181064.html?s=6637b7134a8c5edaa3ef3cec581bb3c0

When you pop a view (or tap on back button) the view is destroyed. In the detailsPage component if you set autoDestroy to false
this will prevent it but I would just create the new view each time you want to push it.

Sencha Touch 交流 QQ 群 224711028 欢迎您的加入

抱歉!评论已关闭.