Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Delay when touching tableview cells
Started by jdsmedeirosbr Apr 23 2018 02:43 PM

No replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 46 posts
  • Corona SDK

Hello, I created an app and inserted a tableView that works perfectly, however, when I click the cell, I call a new scene that sometimes this transition works, sometimes not! is a bug or wrong code?

 

Version used: 2018.3276

 

Part of code...

local function onRowRender( event )

    local row = event.row
    local id = row.index

    local imgTable = display.newImageRect( row,"images/EstrelaLogo.png", 40, 42 )
    imgTable.anchorX = 0
    imgTable.anchorY = 1
    imgTable.x = 8
    imgTable.y = row.height * .5
    
    local text = display.newText(  row, news[id], 12, 0, nil, 17 )--rowData[id]
    text.anchorX = 0
    text.anchorY = 1
    text.x = imgTable.x + imgTable.width + 8
    text.y = row.height * .65
    text:setFillColor( 1, 1, 1 )  

    local textDate = display.newText(  row, dEdit[id] .. "/2018", 12, 0, nil, 13.5 )--rowDate[id]
    textDate.anchorX = 0
    textDate.anchorY = 1
    textDate.x = imgTable.x + imgTable.width + 8
    textDate.y = row.height * .35
    textDate:setFillColor( 0, 0, 0 )

  end

local function onRowTouch( event )
    local phase = event.phase
    local row = event.target

    if event.phase == "release" then
      --for i = 1, tableView:getNumRows() do
        --if i == row.index then    
        --else 
          composer.gotoScene("noticias",{effect = "fromRight", time = 300})
        --end
      --end 
      print(row.index)
    end
  end

tableView = widget.newTableView(
    {
      left = 0,
      top = bar.y + bar.height,
      height = heighTBX - bar.y + bar.height,
      width = display.contentWidth,
      onRowRender = onRowRender,     
      hideBackground = true,
      onRowTouch = onRowTouch
    }
  )

  sceneGroup:insert(tableView)

  for i = 1, 12 do

    tableView:insertRow{
      rowHeight = 43,
      isCategory = false,
      rowColor = {default={1,1,1,0}},
      lineColor = { 1, 1, 1 }
    }  

function scene:hide( event )

  local sceneGroup = self.view
  local phase = event.phase

  if ( phase == "will" ) then         


  elseif ( phase == "did" ) then
    composer.removeHidden()

  end
end 
 

Video here:

 

https://www.facebook.com/jdsmedeiros/videos/1481242185318316/




[topic_controls]
[/topic_controls]