I have a simple iPad app using createSplitWindow to create a master detail window. When I open the master detail window the first time (splitWin.open();) from the calling window, all is good. When I close it (splitWin.close();) and then open it again from the initial calling window, the detail window is no longer full width. What am I missing?
var win1 = Titanium.UI.createWindow({ backgroundColor : 'red', title : 'Red Window' }); var imageView1 = Titanium.UI.createImageView({ image : 'KS_nav_ui.png', top : 50, left : 30 }); imageView1.addEventListener('click', function() { splitWin.open(); }); win1.add(imageView1); win1.open(); //// var masterLeftBtn = Ti.UI.createButton({ title : 'Back', style : Titanium.UI.iPhone.SystemButtonStyle }); var masterRightBtn = Ti.UI.createButton({ right : 10, top : 30, image : "images/05-plus.png" }); masterRightBtn.addEventListener("click", function() { // drawer.toggleLeftWindow(); }); masterLeftBtn.addEventListener("click", function() { splitWin.close(); }); var detailLeftBtn = Ti.UI.createButton({ }); var detailRightBtn = Ti.UI.createButton({ right : 10, top : 30, title : 'Edit', style : Titanium.UI.iPhone.SystemButtonStyle }); detailRightBtn.addEventListener("click", function() { }); detailLeftBtn.addEventListener("click", function() { }); var detail = Ti.UI.createWindow({ backgroundColor : '#ededed', translucent : false, title : "Session Locations", barColor : "#c0c0c0", leftNavButton : detailLeftBtn, rightNavButton : detailRightBtn, width : Ti.UI.FILL, height : Ti.UI.FILL }); var label1 = Ti.UI.createLabel({ text : 'Detail View' }); detail.add(label1); var detailNav = Ti.UI.iOS.createNavigationWindow({ window : detail }); var master = Ti.UI.createWindow({ backgroundColor : 'gray', translucent : false, barColor : "#c0c0c0", // tintColor : "green", leftNavButton : masterLeftBtn, rightNavButton : masterRightBtn, width : Ti.UI.FILL, height : Ti.UI.FILL }); var label2 = Ti.UI.createLabel({ text : 'Master View' }); master.add(label2); var masterNav = Ti.UI.iOS.createNavigationWindow({ window : master }); var splitWin = Ti.UI.iPad.createSplitWindow({ showMasterInPortrait : true, detailView : detailNav, masterView : masterNav }); splitWin.addEventListener('visible', function(e) { if (e.view == 'detail') { e.button.title = "Search"; detail.leftNavButton = e.button; } else if (e.view == 'master') { detail.leftNavButton = null; } });