Windows手机:在listview中加载数据非常慢(Appcelerator Titanium)

时间:2016-06-08 09:53:07

标签: windows-phone appcelerator appcelerator-alloy

我的Windows手机应用程序有问题。 我尝试在列表视图中加载大约80个项目。当我在控制器中执行此操作并在应用程序启动时创建控制器实例时,我会收到超时消息。

当我在应用程序启动后调用loadData方法时,它可以工作,但是加载数据大约需要27秒(在设备上),在模拟器中大约需要4秒,这要好得多,但仍然有点长在我看来。

我不知道导致这种延迟的原因。任何建议都非常感谢。

这是在listview中加载数据的代码。 (Titanium SDK 5.3.0.GA)

function loadData() {
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var fruitDataSet = [
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}},
    {properties: { title: 'test item'}}
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
listView.sections = sections;
Ti.API.info('done');
}

0 个答案:

没有答案