Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10812] Android: Ti.UI.SIZE on width does not work with horizontal layouts

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-14T16:22:36.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-19 Core, 2012 Sprint 19
ComponentsAndroid
Labelscore, module_view, qe-testadded, regression
ReporterAllen Yeung
AssigneeAllen Yeung
Created2012-09-07T13:43:52.000+0000
Updated2012-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.

Comments

  1. Etienne Champetier 2012-09-10

    In TiCompositeLayout.java, if i initialize enableHorizontalWrap to false (instead of true), i get the correct behavior !!!
  2. Etienne Champetier 2012-09-10

  3. Etienne Champetier 2012-09-11

    If you add horizontalWrap:false to the view it work
  4. Allen Yeung 2012-09-12

    PR: https://github.com/appcelerator/titanium_mobile/pull/2911
  5. Anshu Mittal 2012-09-14

    Tested with: SDK:3.0.0.v20120913145712 Studio: 2.1.2.201208301612 Devices:Android emulator, iOS simulator.
  6. Hieu Pham 2012-09-14

    Backport PR: https://github.com/appcelerator/titanium_mobile/pull/2947
  7. Vishal Duggal 2012-09-14

    Reopening to edit fixVersion
  8. Tamila Smolich 2012-09-17

    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.

JSON Source