Titanium Community Questions & Answer Archive

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

Change tab title on Android?

For starters I need to say that this is my first day developing with Titanium. But I haven't found any answer to how to accomplish this after spent way too much time googling the issue.

I have a problems trying to change a tab's title dynamically.

Extract from the code:

var tab1 = Titanium.UI.createTab({  
    title:"some tab",
    window:win
});

// [..]

var textfield = Titanium.UI.createTextField({
    color:'#336699',
    value:"Tab title",
    height:35,
    width:300,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});

// Change the tab's title to textfield.value
textfield.addEventListener("change", function(e) {
    tab1.title = e.value;
});

win.add(textfield);

This works perfectly fine in the iPhone-emulator, but it doesn't work in Android (APIs 1.6). Is it possible to change a tab's title dynamically on the Android? If it is, how?

— asked October 13th 2010 by Alexander Johansson
  • android
  • tabs
  • title
1 Comment
  • I tested it for you, same here. But my geuss is that this only works with iPhone. With iPhone you can also edit the tab order.

    I think you couldn't change the title dynamicaly but you can set this on in advance. With an array of values. Loop or just select values in this array. And assign these to the tab title.

    — commented October 13th 2010 by Jacob van Dam

6 Answers

  • Accepted Answer

    It's not possible on Android. At some point we may release a different tab control, but currently you can't change any aspect of the group once it has been created.

    — answered October 13th 2010 by Don Thorp
    permalink
    1 Comment
    • so if i changing App-Language. I have to restart the App? Hmm…. :/

      — commented December 5th 2011 by dit k
  • Hi, may I know have this been fixed? I'm working on android app, need to change the tab title dynamically after user change language. In iphone not problem, but cannot do that in android… Please help.

    — answered July 18th 2011 by winnie ho
    permalink
    0 Comments
  • Same problem for me. Any idea on how to change the tab title dynamically?

    — answered September 22nd 2011 by Romain Salles
    permalink
    0 Comments
  • Is this now possible in any way?
    It's a necessary feature for multilanguage apps…

    — answered November 10th 2011 by Benjamin Sommerfeld
    permalink
    0 Comments
  • Has anyone been able to solve this or come up with a good workaround? The closest workaround I've heard so far was to close and re-open the tab group. Unfortunately, this causes my application to lock up for some reason. Perhaps it's because my tab group is defined within my app.js file? Please see my related question on stackoverflow. Thanks.

    — answered November 17th 2011 by Joel Hulen
    permalink
    0 Comments
  • They opened a new feature request on JIRA for it. I would suggest you all put a watch to that JIRA ticket, so they see how many people want this feature:

    http://jira.appcelerator.org/browse/TIMOB-6144

    — answered November 21st 2011 by Benjamin Sommerfeld
    permalink
    0 Comments
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.