[TIMOB-5836] iOS: Application does not recognize upside down portrait orientation mode
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2011-12-05T13:16:54.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2011-49 |
Components | iOS |
Labels | n/a |
Reporter | Alan Vaghti |
Assignee | Vishal Duggal |
Created | 2011-10-23T23:54:16.000+0000 |
Updated | 2012-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
File | Date | Size |
---|---|---|
grouch.jpg | 2011-10-23T23:54:16.000+0000 | 52018 |
Screenshot 2011.10.24 00.28.15.png | 2011-10-23T23:54:16.000+0000 | 102588 |
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.
How do we want to close/resolve this?
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?
Tested with MobileSDK version 1.8.0.1, githash 8f6f25b Can not reproduce on either simulator or device.
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