[TIMOB-10812] Android: Ti.UI.SIZE on width does not work with horizontal layouts
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-14T16:22:36.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 2.1.3, Release 3.0.0, Sprint 2012-19 Core, 2012 Sprint 19 |
Components | Android |
Labels | core, module_view, qe-testadded, regression |
Reporter | Allen Yeung |
Assignee | Allen Yeung |
Created | 2012-09-07T13:43:52.000+0000 |
Updated | 2012-10-26T22:45:43.000+0000 |
Description
Run the test case:
var win = Ti.UI.createWindow({ backgroundColor: 'white' });
var view = Ti.UI.createView({ width: Ti.UI.SIZE, height: 30, layout: 'horizontal', backgroundColor: 'red' });
view.add(Ti.UI.createLabel({ text: 'Hello', height: 30, top: 0, color: 'white' }));
view.add(Ti.UI.createLabel({ text: 'From Titanium', height: 30, top: 0, color: 'blue', left: 5 }));
win.add(view);
win.open();
The red view's width should not be size of the screen. This was a regression caused by TIMOB-10003.
In TiCompositeLayout.java, if i initialize enableHorizontalWrap to false (instead of true), i get the correct behavior !!!
If you add horizontalWrap:false to the view it work
PR: https://github.com/appcelerator/titanium_mobile/pull/2911
Tested with: SDK:3.0.0.v20120913145712 Studio: 2.1.2.201208301612 Devices:Android emulator, iOS simulator.
Backport PR: https://github.com/appcelerator/titanium_mobile/pull/2947
Reopening to edit fixVersion
Tested on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120915120319 xCode 4.5 GM seed Devices: Nexus 7 (4.1.1), iPhone Simulator (6.0) The red view does not fill the screen by width.