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();
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/86 Merged into master
Backport to 3.1.x PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/102
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