Titanium Community Questions & Answer Archive

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

tabgroup limitations

I am designing the UI paradigm for a complex project and can't get tabgroups to operate consistently the way I anticipated. In searching the Q&A history, I am coming to the shocking (to me) revelation that a tabgroup may be restricted to the root window.

Is this really true? Is this documented anywhere? Is this a "feature" of iOS and/or Android, or a limitation of the current Titanium SDK that may be lifted in the future?

In my envisioned hierarchy of screens, some of the nested windows would themselves utilize tabgroups with scrollviews to separate controls into logical groupings for the user. But I can't make a nested tabgroup behave right consistently. Do I just need to rethink my paradigm and not use any nested tabgroups?

I'd consider replacing with a TabbedBar, with each button bringing a certain page of a SrollableView to focus, but AFAIK Android OS does not support a TabbedBar.

Are there are documents / blogs / whatever that summarize when UI elements are allowed on which platforms? And which properties don't work with both iOS and Android? For example, one recommendation was to define a tab group on the root window even if you don't need it, then hide it with tabBarHidden:true to allegedly increase performance / memory handling. Yet in another spot it is revealed that Android OS does not support tabBarHidden, making the first suggestion useless for cross-platform work.

It isn't fun to be well down the road expecting to use one design only to find the UI controls don't support the intended usage.

Are there any definitive references available?

— asked November 18th 2010 by Doug Handy
  • design
  • mobile
  • tabgroup
  • ui

2 Answers

  • Accepted Answer

    Doug, I think at the moment you are going to have a difficult time utlising tabgroups in the way that you would like, particularly with regard to your cross-platform objectives. In the long-term though, I believe it could certainly be possible, and even desirable, for them to provide the features you have described.

    I have done quite a bit of experimentation with tabgroups following your question, although only on android. One approach I had was to create multiple tabgroups and open and close them to simulate different "levels" of submenus, which I presume is the effect that you are after. It transpires that this is not possible for android because the tabgroup object is missing the close method, as confirmed in this ticket.

    Then I attempted to add and remove tabs from a single tabgroup, to give a similar effect that would probably not be much more difficult for the developer than my previous technique. However, the removeTab() method did not have any effect, as I described in this ticket.

    That said, there is another solution that would not be difficult either, which is to use Titanium.UI.Views to emulate tabgroups. This would be totally platform-agnostic, with the advantage that you have complete control over their look and behaviour.

    Even better, some kind chap called Christian from the Appcelerator community has generously written some code that creates custom tabs and made it available for everyone. You can find it here.

    I hope you find this info useful. Good luck with your project!

    — answered November 18th 2010 by Paul Dowsett
  • Hal,

    Thank you very much for the reply – yes the info sounds useful and I will research it. Strangely, I never found the solution mentioned when I searched the Q&A for tabgroup and I thought I visited virtually every search result on that word.

    Perhaps the Q&A has more answers and solutions than I give it credit for; I wish I would have found this in my own searches.

    — answered November 19th 2010 by Doug Handy
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.