【发布时间】:2012-12-18 10:13:26
【问题描述】:
我是 Titanium 的新手,我遇到了一个问题。 在我的 app.js 中,我包含一个左侧菜单和窗口控件(app.js 和 leftmenu.js)
我想在用户点击菜单项时加载一个窗口。基本上,我想在用户选择主页按钮时加载 app.js 主窗口。 为此,我在 leftmenu.js 文件中加入了以下代码:
var newWin = Titanium.UI.createWindow({
url: "app.js",
zIndex: 0
});
win.close(); // closing main window
leftMenu.close(); // closing left menu
newWin.open(); //should reload the main window and the leftmenu
它重新加载窗口,但所有控件都被禁用。我们不能点击任何控件。就像所有控件都在一个不可见的层下一样。 有什么想法吗?
我复制/粘贴代码部分,也许会更清楚:)
btnaccueil.addEventListener('click',function(e) {
var newWin = Titanium.UI.createWindow({
url: "app.js",
zIndex: 0
});
// Closing current instance for freeing memory
win.close();
leftMenu.close();
newWin.open({animated:true});
Ti.API.info(var_dump(newWin));
});
【问题讨论】:
标签: titanium appcelerator