I’m just learning LUA/Corona and am wondering if it is possible to have a tableView inside of a ScrollView?
I’ve got the below scroller to enable everything below the navbar to become scrollable.
[lua]
–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”
}
[/lua]
I’m trying to add tables to this ScrollView. Is it possible to simply use widget.newTableView? the only issue I have is that the table will be dynamic in the number of rows that it could contain. It will retrieve JSON data from a API call. So i won’t be able to define the height of the table, as their could be 0 rows or 10. I would want the tableView to be static within the ScrollView, so you can scroll the entire view rather than just the table.
Essentially I’m trying to re-create something like this:
(the right image - where it says waiting for opponent)
I do have a custom background image that I want to assign to each row. So i was thinking simply render an image for each row of data then render the text etc on top of each image, however i’d won’t to have the onRowTouch events and i’d want to assign each row an id which i believe is only possible with TableView?
