Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1667] popover: wrong size when using navigationWindow and missing content (2nd time popover is shown)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2014-09-24T02:14:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, ios, ipad
ReporterMichael Woode
AssigneeMauro Parra-Miranda
Created2014-09-19T13:54:27.000+0000
Updated2016-03-08T07:38:09.000+0000

Description

When using a navigationWindow in a popover, the size specified on the popover is not honored (the first time the popover is displayed) AND the 2nd time (and after that) the popover is displayed with the correct size but the contents of the popover is missing. code to reproduce:
var win = Ti.UI.createWindow({
	backgroundColor:'#fff'
});

var popoverWin = Ti.UI.createWindow({
    title: 'Popover Win',
    backgroundColor:'#ccc',
	// width: '100%',
	// height: '100%',
	// width: Ti.UI.SIZE,
	// height: Ti.UI.SIZE,
	width: 250,
	height: 300,
});


var tableData = [ {title: 'Row 1'}, {title: 'Row 2'}, {title: 'Row 3'}, {title: 'Row 4'}, {title: 'Row 5'} ];

var theTableView = Ti.UI.createTableView({
	data: tableData,
});
popoverWin.add(theTableView);


var test1Btn = Ti.UI.createButton({
	title: 'Open popover',
	top: 50,
	width: 200
});
win.add(test1Btn);

test1Btn.addEventListener('click', function(e) {
	thePopover.show({ view:test1Btn });
});


var test2Btn = Ti.UI.createButton({
	title: 'Don\'t dismiss popover',
	bottom: 50,
	width: 200
});
win.add(test2Btn);

//!!TODO, if the contentView is a navigationWindow the second time you open the popover all content is missing
var navWindow = Ti.UI.iOS.createNavigationWindow({window: popoverWin});

var thePopover = Ti.UI.iPad.createPopover({
	width: 250,
	height: 220,
	// contentView: popoverWin,//!!TODO, with this line uncommented, the tableview don't disappear
	contentView: navWindow,//!!TODO, with this line uncommented, the second time you open the popover the table view is missing
	passthroughViews: [test2Btn]//!!TODO, comment this line to test, the size of the popover, when uncommented the popover size is not correct
});

/**
	XXX
		summary:

			* if using the property passthroughViews, the size of the popover is not the expected one on the first time the popover is shown/opened

			* if using a navigationWindow in a popover the content will disappear the second time the popover is shown/opened

			==> workaround, recreate the popover (within a function) each time the popover should be displayed
	XXX
**/

win.open();

Attachments

FileDateSize
iOS Simulator Screen shot 19 sep 2014 15.39.05.png2014-09-19T13:54:27.000+000057732

Comments

  1. Mauro Parra-Miranda 2014-09-24

JSON Source