Titanium Community Questions & Answer Archive

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

changing title in new windows

hi,

in app.js, i open a new window. i want to set the title and backgroundColor. but when i have both settings inside createWindow(), title gets ignored.

var home = Ti.UI.createWindow({
    width:"auto",
    height:"auto",
    backgroundColor: "#ccc",
    title: "Viessmann EffizienzPlus",
    url: "pages/home.js",
    exitOnClose: true
});
home.open();

is there a solution to this?

— asked November 16th 2010 by marcin kolonko
  • android
  • backgroundcolor
  • title
  • window
1 Comment
  • In my tests the backgroundColor seems to work fine. Could you supply a full script that demonstrates the issue conclusively, and I will check it in my environment. There does indeed seem to be an problem with the title though, so I will get back to you when I have tested it fully.

    — commented November 16th 2010 by Paul Dowsett

4 Answers

  • Accepted Answer

    Marcin

    Please see ticket #2361 regarding the window title issue and some ways to avoid it.

    — answered November 16th 2010 by Paul Dowsett
    permalink
    0 Comments
  • if you use the open() attribute the navBar will not overwrited.
    If you are in a tabView try whit

    Titanium.UI.currentTab.open(home);
    
    — answered November 16th 2010 by Stefano Di Luca
    permalink
    1 Comment
    • He may not be using tabs, though.

      — commented November 16th 2010 by Paul Dowsett
  • marcin

    You can workaround this issue by setting the navBarHidden:false property.

    There is an added advantage of using navBarHidden:true/false on subsequent windows, as it makes that window "heavyweight", and so closing the window using the android back button will simply close the window and not the whole app.

    — answered November 16th 2010 by Paul Dowsett
    permalink
    0 Comments
  • @hal:
    i came across the concept of heavyweight windows as well. but right now i'm on the root window, so i want it to close when hitting back.
    but as with my code snippet, when deleting

    backgroundColor: "#ccc",
    

    the title attribute is recognized and the window has the appropriate name.

    @stefano:
    unfortunatly i'm not in a tabView…

    thanks for answering tho… :)

    — answered November 16th 2010 by marcin kolonko
    permalink
    1 Comment
    • Marcin, I don't have any issues relating to the backgroundColor of a window, and it does not affect whether the title is displayed.

      — commented November 16th 2010 by Paul Dowsett
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.