Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 表视图/滚动视图中的列表_Lua_Coronasdk_Corona Storyboard - Fatal编程技术网

Lua 表视图/滚动视图中的列表

Lua 表视图/滚动视图中的列表,lua,coronasdk,corona-storyboard,Lua,Coronasdk,Corona Storyboard,我正在学习LUA/Corona,我想知道是否有可能在ScrollView中有一个tableView 我有下面的滚动条,使导航栏下面的所有内容都可以滚动 --Setup the nav bar local navBar = display.newImageRect("assets/images/navbar.png", display.contentWidth + 15, 44) navBar.x = display.contentWidth*.5 navBar.y = math.floor(

我正在学习LUA/Corona,我想知道是否有可能在ScrollView中有一个tableView

我有下面的滚动条,使导航栏下面的所有内容都可以滚动

--Setup the nav bar 

local navBar = display.newImageRect("assets/images/navbar.png", display.contentWidth + 15, 44)
navBar.x = display.contentWidth*.5
navBar.y = math.floor(display.screenOriginY + navBar.height*0.5)

local navHeader = display.newText("My Game", 0, 0, "Handlee", 36)
navHeader:setTextColor(255, 255, 255)
navHeader.x = display.contentWidth*.5
navHeader.y = navBar.y

    local scroller = widget.newScrollView
    {
        top = 44,
        width = display.contentWidth,
        height = 568,
        scrollWidth = display.contentWidth,
        scrollHeight = display.contentHeight,
        hideBackground = true,
        horizontalScrollDisabled = true,
        maskFile = "assets/images/mask-320x568.png"
    }
我正在尝试将表添加到此滚动视图。是否可以简单地使用widget.newTableView?我唯一的问题是,该表可能包含的行数是动态的。它将从API调用中检索JSON数据。所以我无法定义表的高度,因为它们可以是0行或10行。我希望tableView在ScrollView中是静态的

本质上,我正在尝试重新创建这样的东西:(正确的图像-上面写着等待对手)


我有一个自定义的背景图像,我想分配给每一行。因此,我想简单地为每行数据渲染一个图像,然后在每个图像的顶部渲染文本等,但是我不希望有onRowTouch事件,我想为每行分配一个id,我认为这只有在TableView中才能实现?

我相信TableView可以作为一个滚动视图。这意味着一旦您的tableView超过屏幕高度,它就提供了自动滚动的机制。根据我的理解,tableView必须单独存在于场景中。没有看到在同一场景(故事板)上有与tableView一起的内容的示例