Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14144] Blackberry: Ti.UI.Views defaults height to FILL if content is SIZE

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-13T22:25:15.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 BB, 2013 Sprint 12, Release 3.1.2, Release 3.2.0
ComponentsBlackBerry
Labelsblackberry, module_view, qe-testadded, regression
ReporterPedro Enrique
AssigneeRussell McMahon
Created2013-06-06T21:00:41.000+0000
Updated2013-07-18T06:45:20.000+0000

Description

Problem

When creating Views, if no height is passed in or if height is set to Ti.UI.SIZE, the height behaves as if it were Ti.UI.FILL when the content's height is set to SIZE.

Code

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
	backgroundColor: 'blue',
	height: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
	text: 'hello world',
	backgroundColor: 'red',
	height: Ti.UI.SIZE
});

view.add(label);
win.add(view);


win.open();

What works

If the content has a hardcoded height, then the outer view will resize accordingly.
var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
	backgroundColor: 'blue',
	height: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
	text: 'hello world',
	backgroundColor: 'red',
	height: 20
});

view.add(label);
win.add(view);


win.open();

Comments

  1. Pedro Enrique 2013-06-13

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/86 Merged into master
  2. Pedro Enrique 2013-06-13

    Backport to 3.1.x PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/102
  3. Priya Agarwal 2013-07-18

    Updated label. Closing as fixed. Verified with environment: Studio: 3.1.2.201307161852 Titanium SDK:3.1.2.v20130710144553 acs:1.0.3 alloy:1.1.3 npm:1.3.2 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:Blackberry-Z10(v 10.0.10.261) blackberry SDK: 10.1.0.1020 Blackberry: Ti.UI.Views height Ti.UI.SIZE working if content is Ti.UI.SIZE

JSON Source