2013-07-04 29 views
3

此代码需要两秒钟来处理。在CoronaSDK中优化tableView插入

print("before loop scholarships:"..system.getTimer()) 
for i = 1, scholarshipTableSize do 

-- Insert the row into the tableView 
tableView:insertRow 
{ 
    isCategory = false, 
    rowHeight = 75, 
    rowColor =  
    { 
     default = { 255, 232, 4 }, 
     over = { 0, 158, 255 }, 
    }, 
    lineColor = { 0, 0, 0 }, 
} 
end 

scholarshipTableSize大约在1200左右。我该如何优化插入以便它更快地执行?

回答

3

当我更新到最新的电晕版本后,时间好得多。大约2毫秒。

现在我正在使用build 2013.1137