[AC-920] Setting popover height via contentView doesn't resize the popover
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Duplicate |
| Resolution Date | 2015-01-06T01:19:29.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | ios, popover |
| Reporter | Bojan Milenkoski |
| Assignee | Shuo Liang |
| Created | 2015-01-05T10:03:27.000+0000 |
| Updated | 2016-03-08T07:37:13.000+0000 |
Description
Setting Popover height and width is deprecated. We should set them on the contentView. This changes the contentView size, but not the popover itself.
Simple test case:
var win = Titanium.UI.createWindow({ title : 'Win', backgroundColor : '#fff' });
var button = Ti.UI.createButton({ title : 'Open Popover!' });
button.addEventListener('click', function(e) {
popover.show({ view : button });
});
win.add(button);
var contentWindow = Ti.UI.createWindow({ backgroundColor : 'green', title : 'Kermit' });
var popover = Ti.UI.iPad.createPopover({
contentView : Ti.UI.iOS.createNavigationWindow({
width : 250,
height : 200,
window : contentWindow
})
});
var label = Ti.UI.createLabel({ text : "It's not easy being green." });
contentWindow.add(label);
label.addEventListener('click', function(e) {
popover.getContentView().setHeight(100);
});
win.open();
Is there a way to resize the popover itself?
As a workaround I can set the width and height on the popover and ignore the deprecation warnings. Hopefully there will be a way to make this happen correctly in 3.5.0.
Duplicate to TIMOB-18278