Setting Rowheight When Using "tableview.newlist" Rather Than Iterating ..

Hello, I’ve done a fair amount of digging and searching and if I’ve simply missed the answer already stated, I apologize.

I just downloaded and started working with Corona yesterday and so far am loving it !  Generally, the ease of getting something functional so quickly is a little intoxicating.  Great work by everyone!

Now to my question – I downloaded and have been experimenting with the ListView2 example here: http://developer.coronalabs.com/content/list-view-2

and am trying to figure out how to control the rowHeight.  I don’t see any actual declaration or even a clear place to insert one.  The specific tableview creation *appears* to be in the lines below:

  myList = tableView.newList{     data=data,      default="listItemBg.png",     over="listItemBg\_over.png",     onRelease=listButtonRelease,     top=topBoundary,     bottom=bottomBoundary,     cat="category",     order=headers,     categoryBackground="catBg.png",     backgroundColor={ 255, 255, 255 },     callback=function(item)              local t = display.newText(item.title, 0, 0, native.systemFontBold, textSize)             t:setTextColor(0, 0, 0)             t.x = math.floor(t.width/2) + 12             t.y = 36              return t         end }

Am I correct in assuming this creates the tableView and if that’s true, can someone point me to the spec where it describes how to spell out things like rowHeight?

I read through the newTableView page and while it appears to be setting rowHeight by iteration, I still don’t see rowHeight listed in the parameter list of options under “Syntax”  I feel like I’m standing on the dock but can’t find the lake …

http://docs.coronalabs.com/api/library/widget/newTableView.html

Thanks so much … and again, I’m sorry if my noob enthusiasm has me blinded a bit …

  • Gary

While I can’t say I found an “official” solution, I did keep tinkering and noticed that the example I’d downloaded was using very “thick” (93 pixels high) background png files for the rows.  I copied/edited them down to 38px and that seems to have been the controlling factor.

Wanted to at least acknowledge that I’d found “a” solution but would still be delighted if there’s a more explicit means to control row heights.

Thanks again,

  • Gary

[lua]

        gameList:insertRow
        {
            isCategory = isCategory,
            rowHeight = 38,
            rowColor = rowColor,
            lineColor = lineColor,
        }

[/lua]

When you insert your row, you specify the rowHeight at that time.

Hi Rob … and thanks for your reply.

I get the part about setting the row height when each row is inserted as one iterates through a list or table but I’m still unsure if there’s a specific way to do it when the entire list is populated as it is in the code I included initially – taken from the List View 2 example.  I’ve scoured that example a number of times and if there’s any iteration going on in populating the rows, I’ve definitely missed it.  Your example looks a lot like the iterating that’s happening in my second link:

tableView:insertRow { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, }

– it’s the first link I can’t get my head around.

I’ve no axe to grind for one method over another but wonder if doing it via the method in the List View 2 example might not be more efficient than iterating so if there is a way to explicitly set the row height in that method other than nudging it with the height of its background I’d really be interested in understanding that.

Thanks again!

  • Gary

While I can’t say I found an “official” solution, I did keep tinkering and noticed that the example I’d downloaded was using very “thick” (93 pixels high) background png files for the rows.  I copied/edited them down to 38px and that seems to have been the controlling factor.

Wanted to at least acknowledge that I’d found “a” solution but would still be delighted if there’s a more explicit means to control row heights.

Thanks again,

  • Gary

[lua]

        gameList:insertRow
        {
            isCategory = isCategory,
            rowHeight = 38,
            rowColor = rowColor,
            lineColor = lineColor,
        }

[/lua]

When you insert your row, you specify the rowHeight at that time.

Hi Rob … and thanks for your reply.

I get the part about setting the row height when each row is inserted as one iterates through a list or table but I’m still unsure if there’s a specific way to do it when the entire list is populated as it is in the code I included initially – taken from the List View 2 example.  I’ve scoured that example a number of times and if there’s any iteration going on in populating the rows, I’ve definitely missed it.  Your example looks a lot like the iterating that’s happening in my second link:

tableView:insertRow { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, }

– it’s the first link I can’t get my head around.

I’ve no axe to grind for one method over another but wonder if doing it via the method in the List View 2 example might not be more efficient than iterating so if there is a way to explicitly set the row height in that method other than nudging it with the height of its background I’d really be interested in understanding that.

Thanks again!

  • Gary