Titanium JIRA Archive
Appcelerator Community (AC)

[AC-920] Setting popover height via contentView doesn't resize the popover

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2015-01-06T01:19:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, popover
ReporterBojan Milenkoski
AssigneeShuo Liang
Created2015-01-05T10:03:27.000+0000
Updated2016-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.

Comments

  1. Shuo Liang 2015-01-06

    Duplicate to TIMOB-18278

JSON Source