Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Which is better: Show/Hide or Add/Remove

If I have a bunch of views that I need to show and hide, is it better to dynamically add and remove them from the containing window, or just show and hide them?

Does removing them from the window free up more memory and potentially make my app faster?


— asked August 23rd 2010 by Clifton Labrum
  • add
  • hide
  • remove
  • show
  • view
  • window

1 Answer

  • Accepted Answer

    I usually work like this:

    I add the view when I need it first time.
    If this view it will be needed many times in the app I only hide it

    If I don't need the view anymore I remove it.

    Removing the view all the time may make the app lighter but the "optical" speed will decrease as creation of elements takes some time.

    Hope it makes sense.

    — answered August 24th 2010 by Dan Tamas
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.