Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2877] iOS: Modal window shows up behind the phones status bar

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-26T13:40:15.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterNils D
AssigneeNeeraj Gupta
Created2011-04-15T03:31:49.000+0000
Updated2012-07-26T21:28:58.000+0000

Description

When opening a modal window, if the windows navBarHidden property is set to true, opening it the first time is fine. After closing it and reopening it, the modal window shows up behind the phones status bar at the top.

Comments

  1. Pedro Enrique 2011-04-15

    I'm confirming that this is a bug with the following code:

       //create our main window
       var win = Ti.UI.createWindow({backgroundColor:'#ccc'});
       //create a button and add it to the window
       var button = Ti.UI.createButton({title:'click to open modal',height:50,width:100});
       win.add(button);
       
       //create a sencond window with a button and a label
       var win2 = Ti.UI.createWindow({backgroundColor:'#999',navBarHidden:true});
       var close = Ti.UI.createButton({title:'close',height:50,width:100});
       var label = Ti.UI.createLabel({text:'this label\'s top is 0', height:20,top:0,backgroundColor:'#fff'});
       win2.add(label);
       win2.add(close);
       
       //open our main window
       win.open();
       
       //listeners to open and close the second window
       button.addEventListener('click', function(){
           win2.open({modal:'true'});
       });
       close.addEventListener('click',function(){
           win2.close();
       });
       

    To reproduce:

    1. Insert this code into app.js
    2. Run the app
    3. Click to open the window
    4. Close the window
    5. Do step 3 again

    I came across this with the following HelpDesk ticker:
    http://developer.appcelerator.com/helpdesk/view/69801">http://developer.appcelerator.com/helpdesk/view/69801

    Tested on Ti SDK 1.6 (Jan 28 2011 19:35 r5341f235)

  2. Stephen Tramer 2011-04-15

    Going to assume this is an iOS bug.

  3. Stephen Tramer 2012-07-26

    Can't reproduce SDK 2.2.0.014b86f, iPhone Sim 5.1

JSON Source