Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5836] iOS: Application does not recognize upside down portrait orientation mode

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-12-05T13:16:54.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-49
ComponentsiOS
Labelsn/a
ReporterAlan Vaghti
AssigneeVishal Duggal
Created2011-10-23T23:54:16.000+0000
Updated2012-01-10T17:35:39.000+0000

Description

1) Create a new project and place the following in the app.js
var win = Ti.UI.createWindow({backgroundColor:'white'});

var img = Ti.UI.createImageView({image:'grouch.jpg'});

win.add(img);

win.orientationModes = [Ti.UI.UPSIDE_PORTRAIT];

win.open();
2) Place the grouch.jpg in the Resources folder 3) Launch project Expected results: Application launches normally and image appears in upside portrait mode Actual results: Application Error: Result of expression 'win.orientationModes' [undefined] is not an object. at app.js (line 1) Notes: Ti.UI.UPSIDE_PORTRAIT is recognized as a valid orientation mode when there are other orientation modes in win.orientationModes[]. This error only occurs when there is only Ti.UI.UPSIDE_PORTRAIT in win.orientationModes[]. In SDK 1.7.2 and 1.7.3, the error appears as 'null' instead of 'undefined' EDIT: Fixed syntax

Attachments

FileDateSize
grouch.jpg2011-10-23T23:54:16.000+000052018
Screenshot 2011.10.24 00.28.15.png2011-10-23T23:54:16.000+0000102588

Comments

  1. Blain Hamon 2011-11-07

    win.orientationModes[Ti.UI.UPSIDE_PORTRAIT]; should be win.orientationModes=[Ti.UI.UPSIDE_PORTRAIT];. Assignment, not fetching. There is an issue that upside_portrait is not considered upon launch unless it's already in that mode. This will be fixed. At the same time, portrait IS considered upon launch even when not in that mode. There is no valid use case where upside_portrait is to be used exclusively. When win.orientationModes=[Ti.UI.UPSIDE_PORTRAIT,Ti.UI.PORTRAIT] is used, the following happens, and IS expected behavior: On iPad, when device is upside down on launch, window opens in UPSIDE_PORTRAIT as expected. When the device is not upside down on launch, window opens in PORTRAIT as it is the default. On iPhone, device ALWAYS launches from portrait (Apple's design and spec), and window In all cases, window will freely rotate between portrait and upside portrait as expected when both orientations are specified.
  2. Blain Hamon 2011-11-07

    How do we want to close/resolve this?
  3. Alan Vaghti 2011-12-01

    Hey Blain, I retested this with 1.8.0.1.v20111201115057 with the correct syntax. The app only appears in portrait, even if the device is held upside down. Even though UPSIDE_PORTRAIT is a strange use case, shouldn't the app still appear in that mode if it is specified as an orientation mode?
  4. Vishal Duggal 2011-12-05

    Tested with MobileSDK version 1.8.0.1, githash 8f6f25b Can not reproduce on either simulator or device.
  5. Michael Pettiford 2012-01-10

    Tested with Ti Studio 1.0.8.201201091758 Ti Mob SDK 1.8.0.1 OSX Lion iPhone 4S, iPad sim Expected result is shown

JSON Source