GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-29T21:03:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 22 API, 2012 Sprint 22 |
Components | n/a |
Labels | Regression, api, developer-preview, module_popover, qe-review, qe-testadded, triage |
Reporter | Federico Casali |
Assignee | Sabil Rahim |
Created | 2012-10-16T22:51:32.000+0000 |
Updated | 2013-01-08T02:54:11.000+0000 |
Problem description
It is not possible to set height/width to automatically size on the Popover contents.
In 1.8.2 the 'auto' property was working fine as expected.
With 2.0 and major, both using 'auto' or Ti.UI.SIZE, the height and weight values are set to zero.
Also without specifying height and width values, those are set to zero.
See attached sample code:
var win = Ti.UI.createWindow({
backgroundColor:'gray'
});
var view = Ti.UI.createView({
right:20,
height:Ti.UI.SIZE,
width:100,
backgroundColor:'white',
borderColor:'black',
});
var label = Ti.UI.createLabel({
text:"Click for opening the Popover"
});
view.add(label);
var contentView = Ti.UI.createView({
height:200,
width:150,
backgroundColor:'blue'
});
var popover = Ti.UI.iPad.createPopover({
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
title: 'Title',
});
popover.add(contentView);
win.addEventListener('click', function(){
popover.show({view:view});
});
win.add(view);
win.open();
PR against master https://github.com/appcelerator/titanium_mobile/pull/3335
Backport PR https://github.com/appcelerator/titanium_mobile/pull/3354
Tested with: SDK: 3.0.0GA, 3.1.0.v20130107133402 Studio: 3.0.1.201212181159 Device: iPad2(v 5.1) Popover height and width are automatically set.