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
Test Code
Pull pending https://github.com/appcelerator/titanium_mobile/pull/1969
Will this fix be merged into 2.0.0/2.0.1, or is it only available in 2.1.0 ?
Verified fixed in SDK 2.1.0.v20120411154414
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)
Reopening to update labels.