Description
We have modal window and a button. when user clicks on the button alert pops up.
The app is supposed to have only portrait orientation which is set in tiApp.xml file.
When alert pops up, the device supports orientation change.
Testcase
Step to reproduce:
1.Tap on the button in the main window,which opens modal window.
2.Tap on the button in modal window that brings up alert dialog.
3.Try rotating the device and orientation is supported
//app.js
var win = Ti.UI.createWindow({
backgroundColor : '#fff',
orientationModes : [Ti.UI.PORTRAIT] //to be sure
});
var clickMeBtn = Ti.UI.createButton({
title : 'Click to open modal window'
});
var cancelBtn = Ti.UI.createButton({
title : 'cancel'
});
var modalWin = Ti.UI.createWindow({
backgroundColor : '#bbb',
modal : true,
orientationModes : [Ti.UI.PORTRAIT] //to be extra double sure
});
var modalButton = Ti.UI.createButton({
title : 'Click to test Orientation'
});
modalWin.add(modalButton);
modalWin.setLeftNavButton(cancelBtn);
win.add(clickMeBtn);
clickMeBtn.addEventListener('click',function(_event){
modalWin.open();
});
modalButton.addEventListener('click', function(e) {
var dialog = Ti.UI.createAlertDialog({
message: 'Rotate device to see the orientaion change',
ok: 'Okay',
title: 'File Deleted'
}).show();
//alert('Rotate device to see the orientaion change');
});
cancelBtn.addEventListener('click', function(e){
modalWin.close();
});
win.open();
In tiapp.xml
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
</iphone>
FYI.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/6065 Backport to 3_4_X https://github.com/appcelerator/titanium_mobile/pull/6066
Tested with Mac osx 10.9.4 Maverics Appcelerator Studio, build: 3.4.0.201409112242 Titanium SDK, build: 3.4.0.v20140912145715 acs@1.0.16 alloy 1.5.0-rc install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium 3.4.0-rc2 titanium-code-processor@1.1.1 Xcode6 Device: iPad Air iOS8 Works as expected, the alert dialog is always in a portrait mode
Hello, We have tested this with Mac osx 10.9.4 Maverics Appcelerator Studio, build: 3.4.0.201409112242 Titanium SDK, build: 3.4.0.v20140912145715 alloy 1.5.0-rc titanium 3.4.0-rc2 Xcode6beta7 Device: iPod iOS8 Simulator: iPhone5s Version 8.0 (550), Simulator rotation was applied. Works as expected, the alert dialog remains in portrait mode.