How To Remove Textfield In Tabbar

Hi,

I creat a TabBar in which there are 3 bars and I put one textfield ( native.newTextField()  ) in one scene( not the real scene)  while the textfield remove function is also in this scene.

But when i switch to  orther  bar  the textfield still on the screen.  :frowning:

How can I remove or hide the native textfield when switch in TabBar?

Thanks~~~

Hi,

Do you use the storyboard library ? If yes, in your scene, did you insert your textfield into the self.view group ?

J.

Hi, Jérôme 

Actually , I use liberty viewController.lua (written by Gilbert   http://developer.coronalabs.com/code/tab-bar   ) for tab bar .

So i dont know the real differences between it and storyboard library.

In my code i insert textfield into the  group ( display.newGroup() )  defined  in the new function in one scene  and  that not work.

I don’t know this lib in particular, but, as far as I see, there is a cleanUp function that removes the group of the scene and thus the objects that have been inserted into this group. This function should be in every scene/lua file within the new function.

Have you considered to move to Storyboard ? This lib is really straight forward, well documented and it is maintained by the Corona team (http://docs.coronalabs.com/api/library/storyboard/index.html).

Hope this helps,
Jérôme.

oh

I see

When i predefine the textfield variable as {}   in main function (global  variable)

And then insert it into a group in one tab scene  where it is defined  as textfield 

That works~~~

Jérôme, thanks for your patient help  :slight_smile:

Actually i am considering to learn about Storyboard

Thanks again~~~

Hi,

Do you use the storyboard library ? If yes, in your scene, did you insert your textfield into the self.view group ?

J.

Hi, Jérôme 

Actually , I use liberty viewController.lua (written by Gilbert   http://developer.coronalabs.com/code/tab-bar   ) for tab bar .

So i dont know the real differences between it and storyboard library.

In my code i insert textfield into the  group ( display.newGroup() )  defined  in the new function in one scene  and  that not work.

I don’t know this lib in particular, but, as far as I see, there is a cleanUp function that removes the group of the scene and thus the objects that have been inserted into this group. This function should be in every scene/lua file within the new function.

Have you considered to move to Storyboard ? This lib is really straight forward, well documented and it is maintained by the Corona team (http://docs.coronalabs.com/api/library/storyboard/index.html).

Hope this helps,
Jérôme.

oh

I see

When i predefine the textfield variable as {}   in main function (global  variable)

And then insert it into a group in one tab scene  where it is defined  as textfield 

That works~~~

Jérôme, thanks for your patient help  :slight_smile:

Actually i am considering to learn about Storyboard

Thanks again~~~