Titanium JIRA Archive
Appcelerator Community (AC)

[AC-962] iOS can rotate once only

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-08-26T06:30:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsTCSupportTriage
ReporterWilton Kwok
AssigneeMauro Parra-Miranda
Created2014-08-07T07:36:46.000+0000
Updated2016-03-08T07:37:17.000+0000

Description

Steps to Reproduce

http://stackoverflow.com/questions/25137525/appcelerator-ios-window-orientation-change-once-only

Actual Result

http://stackoverflow.com/questions/25137525/appcelerator-ios-window-orientation-change-once-only

Expected Result

http://stackoverflow.com/questions/25137525/appcelerator-ios-window-orientation-change-once-only

Comments

  1. Motiur Rahman 2014-08-10

    Hello, We have tested this issue. It’s not a bug, orientation change works as expected when rotates the app to the SAME direction repeatedly. It may be a coding problem.

    Testing Environment:

    Titanium SDK: 3.3.0.GA, Titanium CLI: 3.3.0, IOS Simulator: 7.1, OS X Version: 10.9.3, Appcelerator Studio: 3.3.0

    Steps to Test:

    1. Create an alloy project. 2. Paste this code in the controller and view folder. 3. Run this code with the testing environment. Test Code
       function onButtonClick(e) {
       	var win = Alloy.createController('win1').getView();
       	$.nIndex.openWindow(win);
       }
       
       $.nIndex.open();
       
       
       <Alloy>
       	<NavigationWindow id="nIndex" platform="ios">
       		<Window id="main">
       			<Button id="button" title="Open" onClick="onButtonClick" />
       		</Window>
       	</NavigationWindow>
       </Alloy>
       
       <Alloy>
           <Window class="container">
               <Label color="#fff">Win1</Label>
           </Window>
       </Alloy>
       
       var args = arguments[0] || {};
       var win = null;
       
       Ti.Gesture.addEventListener('orientationchange', changeOrientation);
       function changeOrientation(e) {
           if (Ti.Gesture.isPortrait()) {
               if (win != null) {
                   win.close();
                   win = null;
               }
           } else if (Ti.Gesture.isLandscape()) {
               win = Ti.UI.createWindow({
                   width:Ti.UI.FILL,
                   height:Ti.UI.FILL,
                   fullscreen:true,
                   orientationModes:[ Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT],
                  // navBarHidden:true,
                   backgroundColor:'black',
               });
               var label = Ti.UI.createLabel({
                   text:'Full screen',
                   color:'yellow',
               });
               win.add(label);
               win.open();
           }
       }
       
    Thanks.
  2. Mauro Parra-Miranda 2014-08-26

    Provided a testcase that works fine. Please take a look and if you can reproduce the issue with the modifications, please let us know.

JSON Source