Issue
When you create a window and set win.orientationModes = [Titanium.UI.PORTRAIT]; or set it in Tiapp.xml. Then create an emailDialog or SMSDialog and open that window.
If you proceed to rotate the device into LANDSCAPE the window itself rotates into LANDSCAPE but the statusbar and keyboard remain in PORTRAIT.
Expected behavior
The keyboard and statusBar rotate accordingly. Used to work in 1.7.x - as seen in the screenshots.
Tested on
iPhone 4
iOS simulator 5
TiSDK 1.7 > OK
TiSDK 1.8 > Fail
TiSDK 1.9 > Fail
Steps to reproduce
1) Run code below
2) Click "Email" button
3) Select a field from Email dialog - the keyboard shows up.
4) Rotate device
5) Misbehavior appears suddenly.
Repro sequence
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
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'
});
var button = Ti.UI.createButton({
title:'Email',
height:40
});
button.addEventListener('click', function(){
var emailDialog = Ti.UI.createEmailDialog();
emailDialog.open();
});
win1.add(label1);
win1.add(button);
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
//
// add tabs
//
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
// open tab group
tabGroup.open();
Additional info
If the window is locked doesn't seems to work either. Locked the orientation on iOS:
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
<orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
Closing bug. Verified fix on: SDK build: 2.0.0.v20120315170247 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1)
open to update label