[TIMOB-18278] iOS8: Popover resizing
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | Critical | 
| Status | Closed | 
| Resolution | Fixed | 
| Resolution Date | 2015-01-15T17:34:25.000+0000 | 
| Affected Version/s | n/a | 
| Fix Version/s | Release 4.0.0 | 
| Components | TiAPI | 
| Labels | popover, resize | 
| Reporter | Jérôme Danthinne | 
| Assignee | Vishal Duggal | 
| Created | 2014-12-16T08:26:59.000+0000 | 
| Updated | 2015-01-20T19:26:51.000+0000 | 
Description
	Prior to 3.5.0, I was using $.popover.height = xxx to resize the Popover, and it was working fine. Since 3.5.0.Beta, I was getting messages saying that this was obsolete and that I should use the contentView property.
After converting all my calls to $.popover.contentView.height = xxx, the contentView resizes itself, but the Popover doesn't... so some parts are hidden.
Hi, Please provide a test case to reproduce your problem, that will be really helpful to address the problem. Regards, Shuo
index.xml
<Alloy> <Window id="win"> <Button title="Open Popover" onClick="openPopover" /> <Popover id="popover"> <ContentView> <NavigationWindow> <Window title="Popover" layout="vertical"> <Button title="Resize ContentView" onClick="resizePopover" /> <Button title="Resize ContentView (deprecated)" onClick="resizePopoverDeprecated" /> </Window> </NavigationWindow> </ContentView> </Popover> </Window> </Alloy>$.win.open(); function openPopover(e) { $.popover.show({view:e.source}); } function resizePopover() { $.popover.contentView.height = 300; } function resizePopoverDeprecated() { $.popover.height = 250; }"NavigationWindow": { backgroundColor:"#fff", width:300, height:150 }, "Window": { width:Ti.UI.FILL, height:Ti.UI.FILL }Still buggy in 3.5.0.RC…
And still in 3.5.0.GA :-(
Classic Test Case
var win = Ti.UI.createWindow({backgroundColor:'white'}); var btn = Ti.UI.createButton({title:'SHOW POPOVER'}); win.add(btn); win.open(); var cw = Ti.UI.createWindow({backgroundColor:'blue', title:'POPOVER', layout:'vertical'}) var nWin = Ti.UI.iOS.createNavigationWindow({window:cw, height:Ti.UI.FILL, width: Ti.UI.FILL}) var b1 = Ti.UI.createButton({title:'Toggle ContentView Height', top:30}); var b2 = Ti.UI.createButton({title:'Toggle ContentView Width', top:30}); cw.add(b1); cw.add(b2); var popover = Ti.UI.iPad.createPopover({contentView:nWin}); var fillHeight = true; var fillWidth = true; b1.addEventListener('click',function(){ if(fillHeight == true) { nWin.height = 200; } else { nWin.height = Ti.UI.FILL; } fillHeight = !fillHeight; }) b2.addEventListener('click',function(){ if(fillWidth == true) { nWin.width = 200; } else { nWin.width = Ti.UI.FILL; } fillWidth = !fillWidth; }) btn.addEventListener('click',function(){ nWin.height = Ti.UI.FILL; nWin.width = Ti.UI.FILL; fillHeight = true; fillWidth = true; popover.show({view:btn}); })Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6574
Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.6.0.v20150120095514 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPad Mini 3 (8.1) Built to device using the code above, when resizing the content view the popover resizes along with it. Closing ticket.