Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2361] Android: window, createWindow does not respect title property

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-08T23:19:56.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, window
ReporterPaul Dowsett
AssigneeIngo Muschenetz
Created2011-04-15T03:17:44.000+0000
Updated2017-06-08T23:19:56.000+0000

Description

Environment: android 1.4.X (12 Nov), emulator, on ubuntu

As per http://developer.appcelerator.com/question/80191/changing-title-in-new-windows"> this user's post to the Q&A, and my subsequent tests shown below, I can confirm that the title property is not respected when set at creation time, and the window is not modal/heavyweight.

The problem exists also when a new context is created (win3.js below), and a further context thereafter (not shown).

To workaround this issue, users may set navBarHidden:false, but there may be reasons why they need a lightweight view. Thus, this issue may be regarded as trivial, if this is a rare case.

app.js:

var win1 = Ti.UI.createWindow({
    backgroundColor: "red",
    title: "window title: win1",
    exitOnClose: true
});
win1.open();
var label1 = Ti.UI.createLabel({title:'label: window 1'});
win1.add(label1);


var win2 = Ti.UI.createWindow({
    backgroundColor: "green",
    title: "window title: win2"
});
win2.open();
var label2 = Ti.UI.createLabel({title:'label: window 2'});
win2.add(label2);


var win3 = Ti.UI.createWindow({
    backgroundColor: "blue",
    title: "window title: win3",
    url:'win3.js'
});
win3.open();

win3.js:

var win = Ti.UI.currentWindow;
var label = Ti.UI.createLabel({title:'label: window 3'});
win.add(label);

var win4 = Ti.UI.createWindow({
    backgroundColor: "yellow",
    title: "window title: win4",
    url:'win4.js'
});
win4.open();

Comments

  1. hal 2011-04-15

    Further to this, the is some unintuitive behaviour in relation to setting the title after creation.

    If it is set after the window is opened, the title is displayed:
    If the title is set before the window is opened, the title is not displayed.

    title is displayed:

       var win1 = Ti.UI.createWindow({
           backgroundColor: "red",
           exitOnClose: true
       });
       win1.open();
       win1.title = "window title: win1";
       

    title not displayed:

       var win1 = Ti.UI.createWindow({
           backgroundColor: "red",
           exitOnClose: true
       });
       win1.title = "window title: win1";
       win1.open();
       
  2. hal 2011-04-15

    Possibly, ticket #2786 is related to this post.

  3. Lee Morris 2017-06-08

    Closing ticket as there has been no input for the last 6 years. Any problems, please file a new ticket.

JSON Source