Hi
In my TableView I’m connecting to a SQLite database, which I use to populate the table with content. Now the last 4 lines are missing. I can see them only if the table is isBounceEnabled = true. I have checked my code several times for possible errors, but I cannot find it. Can anyone please help? I have the latest Corona build 2014.2189.
-- Handle row rendering local function onRowRender( event ) local phase = event.phase local row = event.row local function subs(time, height, status, routeh) local t if ( dbRec[row.id].status == 1 ) then t = "top time: "..timeConversion(time) else t = "climbed: "..percentage( height, status, routeh ).."%" end return t end local rowTitleCopy = display.newText( row, dbRec[row.id].routeName, 0, 0, nil, fontTitle ) rowTitleCopy.x = row.x - ( row.contentWidth \* 0.5 ) + ( rowTitleCopy.contentWidth \* 0.5 ) + 14 rowTitleCopy.y = row.contentHeight \* 0.3-1 rowTitleCopy:setTextColor( 255,255,255 ) local rowTitle = display.newText( row, dbRec[row.id].routeName, 0, 0, nil, fontTitle ) rowTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( rowTitle.contentWidth \* 0.5 ) + 15 rowTitle.y = row.contentHeight \* 0.3 rowTitle:setTextColor( 244,0,0 ) local subTitle = display.newText( row, "made by: " .. dbRec[row.id].author, 0, 0, nil, fontSubmenu ) subTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( subTitle.contentWidth \* 0.5 ) + 15 subTitle.y = row.contentHeight - 24 subTitle:setTextColor( 90, 90, 90 ) local subTitle2 = display.newText( row, subs(dbRec[row.id].timeBest, dbRec[row.id].topHeight, dbRec[row.id].status, dbRec[row.id].routeH ), 0, 0, nil, fontSubmenu ) subTitle2:setReferencePoint( display.CenterRightReferencePoint ) subTitle2.x = row.contentWidth - 20 subTitle2.y = row.contentHeight - 24 subTitle2:setTextColor( 90, 90, 90 ) end -- Handle touches on the row local function onRowTouch( event ) local phase = event.phase if "release" == phase then storyboard.state.routeId = dbRec[event.target.index].routeId jsonCopy.saveTable(myGameSettings, "mygamesettings.json") storyboard.gotoScene( "scene3","slideLeft", 200) return true end end local options3 = { width = 20, height = 10, numFrames = 3, sheetContentWidth = 20, sheetContentHeight = 30 } local scrollBarSheet = graphics.newImageSheet( "images/scrollBar.png", options3 ) -- Create a tableView tableView = widget.newTableView { top = 100, left = 30, width = width-60, height = height - 150, backgroundColor = {248,236,199}, --maskFile = "assets/mask-320x366.png", listener = tableViewListener, noLines = true, --isBounceEnabled = false, rowTouchDelay = 250, --hideBackground = true, onRowRender = onRowRender, onRowTouch = onRowTouch, scrollBarOptions = { sheet = scrollBarSheet, --reference to the image sheet topFrame = 1, --number of the "top" frame middleFrame = 2, --number of the "middle" frame bottomFrame = 3 --number of the "bottom" frame }, } screenGroup:insert( tableView ) --print all the table contents for row in db:nrows("SELECT \* FROM main WHERE difficulty=" .. diff .. " ORDER BY climbed\_status, topHeight DESC") do idx = idx + 1 dbRec[idx] = {} dbRec[idx].routeId = row.route\_id dbRec[idx].routeName = row.route\_name dbRec[idx].difficulty = row.difficulty dbRec[idx].status = row.climbed\_status dbRec[idx].topHeight = row.topHeight dbRec[idx].count = row.count dbRec[idx].routeH = row.height dbRec[idx].timeBest = row.my\_time dbRec[idx].author = row.author print( "idx = ", idx ) local isCategory = false local rowHeight = rowSize local rowColor if ( dbRec[idx].routeId == 1 ) and ( myGameSettings.firstPlay ) then rowColor = { default = { 255,205,5 }, over = { 224, 213, 179 }, } else rowColor = { default = { 248,236,199 }, over = { 224, 213, 179 }, } end local lineColor = { 220, 220, 220 } tableView:insertRow { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, id = idx, --lineColor = lineColor, } end