Is there any chance to hide tabBar in certain scenes?

Hello, I am pretty new to Corona sdk and I stumbled upon a problem. 
In my app, there is a “welcome” screen and I dont want to show a tabbar in this view. I tried to search google and forums, but i cant find an answer. Is there any chance i  can “hide” the tabBar or something like that?

Thanks in advance :slight_smile:

A lot depends on how you’re building the tabBar. If like most apps, you want the tabBar visible all or most of the time, you create it and never add it to the scene manager. That way, it’s always on top of the scenes. We informally call this HUD mode (heads up display) where things not in a scene’s view group sits on top.

If you want it to be scene dependent, you can always add the tabBar to the scene’s view. But perhaps the easiest way is to simply hide it when you don’t want it:

myTabBar.isVisible = false

to show it again:

myTabBar.isVisible = true

(assuming your tabBar is named myTabBar of course)

Rob

Thanks for your quick answer, however I would have to access myTabBar from different .lua file and I am not quite sure how do I do it.

(My create code for tabBar is in “main.lua” and I want for example “view3” with hidden tabBar.
 

I tried to figure it out and made a new project to understand how it works, following this. I still cant understand this part:

–my global space

local M = {}

return M

Do i fill M{} with variables I want to share in future? something like this:

or not?

local M = {myVariable = 0} return M --different .lua file local myData = require ("main") myData.myVariable = 10

I always get an error: <eof> expected near display or anything like that. Even if I keep it without {myVariable}.

I think that this question seriously belongs to “newbie questions”. :slight_smile: I would be really glad if somebody could explain to me how do I make it actually work. Thanks!

return M has to be the last line of the module. Move it to the bottom.

Rob

Oh great thanks for the tip! 

A lot depends on how you’re building the tabBar. If like most apps, you want the tabBar visible all or most of the time, you create it and never add it to the scene manager. That way, it’s always on top of the scenes. We informally call this HUD mode (heads up display) where things not in a scene’s view group sits on top.

If you want it to be scene dependent, you can always add the tabBar to the scene’s view. But perhaps the easiest way is to simply hide it when you don’t want it:

myTabBar.isVisible = false

to show it again:

myTabBar.isVisible = true

(assuming your tabBar is named myTabBar of course)

Rob

Thanks for your quick answer, however I would have to access myTabBar from different .lua file and I am not quite sure how do I do it.

(My create code for tabBar is in “main.lua” and I want for example “view3” with hidden tabBar.
 

I tried to figure it out and made a new project to understand how it works, following this. I still cant understand this part:

–my global space

local M = {}

return M

Do i fill M{} with variables I want to share in future? something like this:

or not?

local M = {myVariable = 0} return M --different .lua file local myData = require ("main") myData.myVariable = 10

I always get an error: <eof> expected near display or anything like that. Even if I keep it without {myVariable}.

I think that this question seriously belongs to “newbie questions”. :slight_smile: I would be really glad if somebody could explain to me how do I make it actually work. Thanks!

return M has to be the last line of the module. Move it to the bottom.

Rob

Oh great thanks for the tip!