我知道这有点晚了,但它是我用来解决这个问题的解决方案,希望它仍然有用。基本上,它涉及将滚动视图的不透明度设置为 0,直到您完成加载。这意味着,它们不是一次出现 1 行,而是同时出现,并且可以在您的程序/用户执行其他操作时在后台运行。请注意,它仅在 scrollView 为空时才有效 - 对于向其中已有内容的 scrollView 添加行不是一个好的解决方案:
var sView = Titanium.UI.createScrollView({
//Whatever properties you need for your scrollView
opacity: 0,
});
//childViews is an array of all the stuff you'd like to add to sView
childCount = childViews.length
//Add a postlayout event to the last childView - this will automatically set the opacity to 1 when the last child is loaded
childViews[childCount - 1].addEventListener('postlayout', function showScrollView(e){
this.parent.setOpacity(1);
this.removeEventListener(showScrollView);
});
//Iteratively add each view in the array to the sView
for (var x = 0; x < childCount; x++) {
sView.add(childViews[x]);
}
window.add(sView);