window.close()对所述窗口的内容做了什么?

Ell*_*lle 1 window titanium

我有以下代码:

// Initiate the font choosing lists.
var headerListWindow = Titanium.UI.createWindow();

var headerFontListData = [{title:"Row 1"},{title:"Row 2"},{title:"Row 3"}];
var headerFontList = Titanium.UI.createTableView({data:headerFontListData});

chooseHeader.addEventListener('click', function(e) {
    headerListWindow.left=win.width;

    var a = Titanium.UI.createAnimation();
    a.left = 0;
    a.duration = 1000;  

    headerListWindow.add(headerFontList);

    headerListWindow.open(a);
});

headerFontList.addEventListener('click', function(e) {
    var a = Titanium.UI.createAnimation();
    a.left = win.width;
    a.duration = 1000;

    headerListWindow.close(a);
});
Run Code Online (Sandbox Code Playgroud)

这很好地滑动了一个窗口.当我headerListWindow第一次打开时,一切都会出现,列表正常工作,窗口滑动得很好.close()但是,当我在窗口中时,所有列表元素的名称都将恢复为"R".然后,在重新打开窗口时,列表元素完全消失.为什么是这样?

bli*_*app 8

.close()杀了你的窗户.它被传递了.这个窗口已经没有了.它已不复存在.它已经过期并且去了它的制造商.这很僵硬.丧失生命.它安息吧...等等

当你的窗户关闭时,你正在摧毁它.您可能希望尝试使用.hide()而不会使窗口无效,但只是不在屏幕上显示.

  • __Wat:__"你是什么意思,死了?" __Roland:__"他生命的火花在shite中被扼杀.他的精神已经消失,但他的恶臭依旧.这回答了你的问题吗?" (2认同)