Navigation tricks needed

Hi.

My first project here.

I’m working on a mobile app.

I started with the TabBar Application.

In the home, I’m setting other two buttons (newImageRect) and add the listener.

When a button is pressed I use composer.gotoScene() to move to another page.

I need to deselect all the tab button for a correct navigation. How can I obtain this?

I only find tabBar:setSelected() but select a tab (any) when I really need none to be selected

Under normal design patterns, there should always be an active tab. We do not support de-selecting all tabs.

That said, the widget source is open for you to download and modify to your own needs:  https://github.com/coronalabs/framework-widget

Rob

Thank you.

I found a different solution. I redefined in the new scene as this:

local function changeTabBar() -- Unselect TabButton   tabBar:removeSelf()     local tabButtons = {    { label="Home", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/home.png", overFile="icons/home.png", width = 32, height = 32, onPress=onHomeView },    { label="Preferiti", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/preferred.png", overFile="icons/preferred.png", width = 32, height = 32, onPress=onPreferredView },    { label="Profilo", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/profile.png", overFile="icons/profile.png", width = 32, height = 32, onPress=onProfileView },   }   tabBar = widget.newTabBar{    top = display.contentHeight - 50, -- 50 is default height for tabBar widget    height = 70, -- adjusting selected tab graphics    buttons = tabButtons   }  end

Under normal design patterns, there should always be an active tab. We do not support de-selecting all tabs.

That said, the widget source is open for you to download and modify to your own needs:  https://github.com/coronalabs/framework-widget

Rob

Thank you.

I found a different solution. I redefined in the new scene as this:

local function changeTabBar() -- Unselect TabButton   tabBar:removeSelf()     local tabButtons = {    { label="Home", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/home.png", overFile="icons/home.png", width = 32, height = 32, onPress=onHomeView },    { label="Preferiti", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/preferred.png", overFile="icons/preferred.png", width = 32, height = 32, onPress=onPreferredView },    { label="Profilo", labelColor = { default={ 0.5, 0.5, 0.5 }, over={ 0, 0.5, 0 } }, defaultFile="icons/profile.png", overFile="icons/profile.png", width = 32, height = 32, onPress=onProfileView },   }   tabBar = widget.newTabBar{    top = display.contentHeight - 50, -- 50 is default height for tabBar widget    height = 70, -- adjusting selected tab graphics    buttons = tabButtons   }  end