Window.CommandBar
which is associated with
Ti.UI.Window
disappears when creating new
Window
from
Tab
. For example in following sample code the CommandBar which is associated with
win1
disappears after closing overlapping Window. It's ok to hide it when overlapping Window is active, but it should restored when overlaping Window is closed.
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title: 'Tab 1',
backgroundColor: '#fff'
});
var tab1 = Titanium.UI.createTab({
icon: 'KS_nav_views.png',
title: 'Tab 1',
window: win1
});
var label1 = Titanium.UI.createLabel({
color: '#999',
text: 'I am Window 1',
font: { fontSize: 20, fontFamily: 'Helvetica Neue' },
textAlign: 'center',
width: 'auto'
});
win1.add(label1);
var platform = Ti.Platform.osname;
if (platform === 'windowsphone' || platform === 'windowsstore') {
var commandBar1 = Ti.UI.Windows.createCommandBar();
var addButton = Ti.UI.Windows.createAppBarButton({ icon: Ti.UI.Windows.SystemIcon.ADD });
addButton.addEventListener('click', function () {
var window = Ti.UI.createWindow({ backgroundColor: 'green' });
var closeButton = Ti.UI.createButton({ title: 'Close' });
closeButton.addEventListener('click', function () {
window.close();
});
window.add(closeButton);
window.open();
});
commandBar1.items = [addButton];
win1.add(commandBar1);
}
tabGroup.addTab(tab1);
tabGroup.open();
https://github.com/appcelerator/titanium_mobile_windows/pull/370
Verified the fix. The commandbar does not disappear. Closing. Environment: Appc Studio: 4.1.1.201507141126 Ti SDK: 4.2.0.v20150724170431 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0 APPC CLI: 4.1.2 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1