Hello, I have a tableview and I’d like to fade in an element when the user has decided to delete one of the rows. I can transition to the whole row, but how can I fade in a graphic that is in that row? Here is what I have tried so far…
local function onRowRender( event ) local row = event.row local rowHeight = row.contentHeight local rowWidth = row.contentWidth local whichOne = BookmarksTable[row.index][1] local rowTitle = display.newText( row, buttonColors[BookmarksTable[row.index][1]][4] , 0, 0, "Univers-Light", 24 ) rowTitle:setFillColor( 0 ) rowTitle.anchorX = 0 rowTitle.x = 100 rowTitle.y = rowHeight \* 0.3 local delImage = display.newImage(row, "assets/delete\_gradient.png", true) delImage.anchorX, delImage.anchorY = 0, 0 delImage.x = 100 delImage.y = 0 delImage.alpha = 0.5 end
local function onRowTouch( event ) local row = event.target if event.phase == "press" then elseif event.phase == "swipeLeft" then print( "Swiped left." ) delRow = event.target if (delRow.id == nil) then print("swiped empty area") else transition.to( delRow, { time = 250, x = -50 } ) transition.to( delRow.delImage, { time = 250, alpha = 1.0 } ) local alert = native.showAlert( "Bookmark", "Delete bookmark?", { "No", "Yes" }, onDELComplete ) end elseif event.phase == "swipeRight" then print( "Swiped right." ) elseif event.phase == "tap" then print( "Tapped." ) end return true end
The second transitionto “transition.to( delRow.delImage,…” is what isn’t giving an error or working.
Any ideas where I went wrong, or how to do it correctly?
Thanks!