lua - 优化 Corona SDK 中的 TableView 插入

标签 lua coronasdk

这段代码需要两秒钟的时间来处理。

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。我如何优化此插入以使其执行得更快?

最佳答案

在我更新到最新的 corona 版本后,时间好多了。大约 2 毫秒。

现在我使用的是 build 2013.1137

关于lua - 优化 Corona SDK 中的 TableView 插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17463932/

相关文章:

lua - 在数学环境中评估 Lua 中的表达式

Lua:调用 __index 函数有效然后抛出错误

lua - 如何在corona sdk中使用admob广告?

arrays - 如何在Corona SDK/LUA中创建随机显示图像和播放音频文件的功能?

coronasdk - Corona SDK - ScrollView 中的 native 文本字段?

c++ - 与C++中的Lua表操作最接近的是什么?

c++ - 以 Python 方式调用 Lua 函数,即命名参数

ssl - NodeMCU Lua Websockets 安全不适用于 2.0 基线

ios - 如何在 iOS 中修复 "NSURLErrorDomain error code -999"

lua - 为什么我的事件处理程序不允许我访问 event.target?