Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8559] iOS: Vertical layout window with navgroup acts like absolute layout in iOS 4.3

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-18T15:43:06.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.1.0, Release 2.0.1, Sprint 2012-08
ComponentsiOS
Labelsmodule_layout, qe-testadded
ReporterShawn Lipscomb
AssigneeVishal Duggal
Created2012-04-05T07:31:31.000+0000
Updated2012-04-30T21:48:19.000+0000

Description

Problem

There is a regression in Composite Layouts in SDK 2.0.0.v20120325213306 and later, including 2.1.0.v.... Controls that are added to 'vertical' layout windows are positioned as if the window had an 'absolute' layout setting. Works fine in iOS 5.0 BROKEN in iOS 4.3 Works fine in SDK 2.0.0.v20120322231759 (any iOS version)

Testcase

- Set up a new project to use the 2.0.0.v20120325213306 SDK. - Drop the following code into app.js and run on the iPhone 4.3 simulator. - The label will appear centered in the window. *This is incorrect*...it should appear at the top of the window, immediately below the nav bar. - Rerun on the iPhone 5.0 simulator. - The label appears correctly at the top of the window, immediately below the nav bar. app.js
var win1 = Ti.UI.createWindow({layout:'vertical'});

var lbl1 = Ti.UI.createLabel({text:'Should be immediately below the navbar',
                              color:'blue',
                              backgroundColor:'white',
                              width:Ti.UI.SIZE,
                              height:Ti.UI.SIZE});
win1.add(lbl1);

var ng = Ti.UI.iPhone.createNavigationGroup({window:win1});
var NavBase = Ti.UI.createWindow();
NavBase.add(ng);
NavBase.open(); // this opens win1 automatically

Comments

  1. Vishal Duggal 2012-04-09

    Test Code
       var rootWin   = Ti.UI.createWindow({layout:'vertical'});
       
       
       var lbl1 = Ti.UI.createLabel({text:'Should be immediately below the navbar',
                                     color:'blue',
                                     backgroundColor:'white',
                                    	});
                                    	
       rootWin.add(lbl1);
        
       var btnOpenWin = Ti.UI.createButton({
         title : "open new window",
         width : 200,
         height  : 35
       });
        
       btnOpenWin.addEventListener('click', function()
       {
         var win2 = Ti.UI.createWindow({layout:'vertical'});
         var lbl2 = Ti.UI.createLabel({text:'I am second window',
                                     color:'blue',
                                     backgroundColor:'white',
                                    });
                                    win2.add(lbl2);
         ng.open(win2, {animated:true});
         
       });
        
       rootWin.add(btnOpenWin);
        
       ng = Ti.UI.iPhone.createNavigationGroup({window:rootWin});
       var NavBase = Ti.UI.createWindow();
       NavBase.add(ng);
       NavBase.open(); // this opens the "root" window, automatically
       
  2. Vishal Duggal 2012-04-09

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/1969
  3. Shawn Lipscomb 2012-04-11

    Will this fix be merged into 2.0.0/2.0.1, or is it only available in 2.1.0 ?
  4. Shawn Lipscomb 2012-04-12

    Verified fixed in SDK 2.1.0.v20120411154414
  5. Wilson Luu 2012-04-13

    Closing bug. Verified fix on: SDK build: 2.0.1.v20120412163344 Titanium Studio, build: 2.0.1.201204111749 xcode: 4.3 Device: iPhone 3GS (4.3), iPhone 4S (5.1)
  6. Wilson Luu 2012-04-18

    Reopening to update labels.

JSON Source