var win = Ti.UI.createWindow({
orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT]
});
var navWin = Ti.UI.iOS.createNavigationWindow({window: win});
var button = Ti.UI.createButton({
width: 200,
height: 50,
title: "Open New Window"
});
button.addEventListener("click", function() {
var win2 = Ti.UI.createWindow({
orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
});
navWin.openWindow(win2);
});
win.add(button);
navWin.open();
Opening win2 by clicking the button, after opening the window change the orientation of the simulator to either landscape then press the navigation windows back button, now the all the sudden the StatusBar is gone from the application, rotating the simulator back to portrait will bring it back but shouldn't it appear as soon as the forced orientation change is made?
Problem can be reproduced on IOS 8.1 and SDK 3.4.0.
I can confirm: Ti.UI.Window as main container: https://gist.github.com/sfeather/0c480fde2bbde3f27a22 Ti.UI.iOS.NavigationWindow as main container: https://gist.github.com/sfeather/dfe3c329887ae1f903db Ti.UI.TabGroup as main container: https://gist.github.com/sfeather/7b867201ef648a9d9e21 dk.napp.drawer as main container. The key seems to be that if the orientation of the device changes while the child is open, then the main container refresh breaks. http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/5d152d89-5471-4fdf-a3e4-1dc983bd9b30/00000825.png Last known working SDK would have been around 3.2.3 (this is based solely upon commits and delivery of an app that had similar functionality) Tested with 3.4.1.GA, 3.5.0.GA, 3.6.0.v20150120195731. *This prevents the shipping of two apps.*
Operating System Name = Mac OS X Version = 10.10.1 Architecture = 64bit # CPUs = 4 Memory = 24.0GB Node.js Node.js Version = 0.10.29 npm Version = 1.4.14 Titanium CLI CLI Version = 3.4.1 node-appc Version = 0.2.14 Java Development Kit Version = 1.6.0_65 Java Home = /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Xcode 6.1.1 (build 6A2008a) - Xcode default Install Location = /Applications/Xcode.app/Contents/Developer iOS SDKs = 8.1 iOS Simulators = 8.1 Supported by TiSDK 3.5.0.GA = yes Connected iOS Devices Feather Direct's iPhone 6+ UDID = 09d1cc7a500c7298dfb3f9babcd5a0ae2254982b Type = iPhone (#3b3b3c) iOS Version = 8.1.2 CPU Architecture = arm64I do know that Apple deprecated the usage of forced orientation modes, leading us to deprecate similar usages in 3.4.0: http://docs.appcelerator.com/titanium/release-notes/?version=3.4.0.GA#deprecated_ios [~jalter], [~vduggal], thoughts?
This behavior is intentional. It is bad UI design to force orientations and we will be dropping support for forcing orientations in a future release. If you really want to do this, use modal windows.
Example
var win = Ti.UI.createWindow({ orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT] }); var navWin = Ti.UI.iOS.createNavigationWindow({window: win}); var button = Ti.UI.createButton({ width: 200, height: 50, title: "Open New Window" }); button.addEventListener("click", function() { var win2 = Ti.UI.createWindow({ orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT], modal: true, backgroundColor: 'blue' }); var button2 = Ti.UI.createButton({ width: 200, height: 50, title: "Close Window" }); button2.addEventListener('click', function() { win2.close(); }); win2.add(button2); win2.open(); }); win.add(button); navWin.open();