Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18278] iOS8: Popover resizing

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-01-15T17:34:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.0.0
ComponentsTiAPI
Labelspopover, resize
ReporterJérôme Danthinne
AssigneeVishal Duggal
Created2014-12-16T08:26:59.000+0000
Updated2015-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.

Comments

  1. Shuo Liang 2014-12-17

    Hi, Please provide a test case to reproduce your problem, that will be really helpful to address the problem. Regards, Shuo
  2. Jérôme Danthinne 2014-12-17

    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>
       
    index.js
       $.win.open();
       function openPopover(e) {
       	$.popover.show({view:e.source});
       }
       function resizePopover() {
       	$.popover.contentView.height = 300;
       }
       function resizePopoverDeprecated() {
       	$.popover.height = 250;
       }
       
    index.tss
       "NavigationWindow": {
       	backgroundColor:"#fff",
       	width:300,
       	height:150
       },
       "Window": {
       	width:Ti.UI.FILL,
       	height:Ti.UI.FILL
       }
       
  3. Jérôme Danthinne 2014-12-20

    Still buggy in 3.5.0.RC…
  4. Jérôme Danthinne 2015-01-15

    And still in 3.5.0.GA :-(
  5. Vishal Duggal 2015-01-15

    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});
       })
       
  6. Vishal Duggal 2015-01-15

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6574
  7. Ewan Harris 2015-01-20

    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.

JSON Source