移动到下一个场景后,如何返回corona sdk中的场景?

移动到下一个场景后,如何返回corona sdk中的场景?,sdk,lua,coronasdk,Sdk,Lua,Coronasdk,我需要一些帮助, 我在corona sdk中制作了一个应用程序,包含4个场景,主场景,列表,tab1,tab2,主场景通过一个按钮将你带到列表场景,列表将你带到tab1,tab1将你带到tab2,我试图做的是通过按下一个按钮使tab2返回到场景列表,当我按下按钮时,什么都没有发生 local button1 = widget.newButton { left= 250, top= 650, defaultFile = "red1.png", label

我需要一些帮助, 我在corona sdk中制作了一个应用程序,包含4个场景,主场景,列表,tab1,tab2,主场景通过一个按钮将你带到列表场景,列表将你带到tab1,tab1将你带到tab2,我试图做的是通过按下一个按钮使tab2返回到场景列表,当我按下按钮时,什么都没有发生

local button1 = widget.newButton

    {

    left= 250,
    top= 650,
    defaultFile = "red1.png",
    label = "select chapter",
    font = "Arial",
     fontSize = 34,
    onEvent = handleButtonEvent,
    onPress = function() storyboard.gotoScene( "list" ); end,
    selected = true

}

您似乎正在使用一个函数来处理带有“onEvent=handleButtonEvent”的botton事件

您应该改为使用该函数进行转换:

-- Function to handle the press of the button
local function handleButtonEvent(event)
    if ( "ended" == event.phase) then
        storyboard.gotoScene("list")
    end
end

你甚至可能在寻找这样的东西;此函数将使用户返回到上一场景

-- Function to handle the press of the button
local function handleButtonEvent(event)
    if ( "ended" == event.phase) then
        storyboard.gotoScene(storyboard.getPrevious())
    end
end

谢谢,我这样做了,但它就像进入了场景列表,但没有改变tab2中的内容!我看到表2了,我不知道怎么了!在进入列表场景时,您希望更改tab2中的哪些“内容”?tab2显示分数,我希望在按下按钮返回列表场景时,您可以重新开始!听起来你没有正确地创建场景。我建议你遵循这个教程:因为它将带你通过科罗纳的故事板!非常感谢,通过添加故事板,它起到了作用。removeAll()哈哈!
-- Function to handle the press of the button
local function handleButtonEvent(event)
    if ( "ended" == event.phase) then
        storyboard.gotoScene(storyboard.getPrevious())
    end
end