Hello! I have a tabbar in main.lua like this:
-- EVENTI BOTTONI TABBAR: local function onGenerateView(event) composer.gotoScene("scenes.generate", {effect = "slideRight"}) end local function onInfoView(event) composer.gotoScene("scenes.info", {effect = "fromBottom"}) end local function onOptionsView(event) composer.gotoScene("scenes.options", {effect = "slideLeft"}) end -- BOTTONI TABBAR: local tabButtons = { { label = "", defaultFile = "img/buttons/home.png", overFile = "img/buttons/home.png", width = 28, height = 28, onPress = onGenerateView, selected = true}, { label = "", defaultFile = "img/buttons/info.png", overFile = "img/buttons/info.png", width = 28, height = 28, onPress = onInfoView}, { label = "", defaultFile = "img/buttons/options.png", overFile = "img/buttons/options.png", width = 41.6, height = 28, onPress = onOptionsView}, } -- TABBAR: local tabBar = widget.newTabBar{ top = display.contentHeight - 42, -- 50 is default height for tabBar widget buttons = tabButtons }
And a function in optionsList.lua (a scene which is NOT connected to any tabbar button and is called by a composer.gotoScene function in options.lua) triggered on onPress button like this:
local function backToGenerate() composer.gotoScene("scenes.generate", {effect = "slideRight"}) end
Now, when the function is called onPress, it properly gets me to generate.lua scene. But then the Options tabbar button won’t work, unless I press the Generate tabbar button (i.e. the scene where I already am, since the function sent me there). It looks like the tabbar is not updated/refreshed. Composer “thinks” I’m still in optionsList scene, until I manually press the tabbar button of the scene where I already am (Generate).
I hope I have explained myself and that someone can help. Thank you in advance!
Pietro