[TIMOB-4888] iOS: app does not rotate to landscape if it is launched while the device is in landscape
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-11-16T11:19:42.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | Sprint 2011-37, Release 1.7.4, Release 1.8.0, Release 1.8.0.1 |
Components | iOS |
Labels | module_orientation, qe-testadded |
Reporter | Jon Alter |
Assignee | Blain Hamon |
Created | 2011-08-03T18:08:16.000+0000 |
Updated | 2014-06-19T12:46:26.000+0000 |
Description
When you hold the device in landscape and the launch the app it fires up in portrait as it should but it does not rotate to landscape as it should. It does rotate to landscape after you rotate the device to portrait and then back to landscape.
If launching the app on a device that is in landscape, the app should launch in portrait and then rotate to landscape. You can see this using the mail app.
Step 1: run the code below
Step 2: hold the device in landscape before launching the app (this is the same for the simulator, you just need to rotate it to landscape before the app launches)
Step 3: launch the app
Step 4: notice that the app does not rotate to landscape after it launches
Step 5: rotate the device to portrait and then back to landscape
Step 6: notice that the app rotates to landscape
var win = Ti.UI.createWindow({
backgroundColor: 'blue',
orientationModes: [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
});
var label = Ti.UI.createLabel({
text: "I am a string"
});
win.add(label);
win.open();
As per Blain, tiapp.xml orientation attributes must be changed to the following for a proper test case:
resolved https://github.com/appcelerator/titanium_mobile/pull/464
Fix verified on iPhone 4 4.2.10, iPod 3rd gen 4.0.2, and iPad 4.3.5. SDK used for testing: 1.8.0v20110915101349
verified fixed with SDK 1.7.4.v20111021114614 on iPhone 4 (iOS 5), iPod touch 4th gen (iOS 4.3.5)
Reopening as I failed to try the simulator. Verified fixed with SDK 1.7.4.v20111021181815, iPod Touch 3rd gen (iOS 4.0.2), iPad2 (iOS 5.0). Verified not functioning on simulator when quickly switching to landscape just before launch, or when launch from simulator home, the bug occurs. Lowering severity since this is only affecting the simulator.
With TiApp only specifying iPhone orientation "portrait" with no iPad orientation set in Tiapp, the applications on the first launch with device in landscape will load with the portrait splash as expected, but the UI will not rotate to landscape after load until the device is rotated. On subsequent launches it works as expected. This is a more important issue for pre-4.0 devices as each launch is a "first launch".
Having to note, that despite it being logical, rotating the simulator does not always translate into a physical rotation. In other words, if the device UI is in portrait yet on its side when launching the app, the OS gives no landscape rotation event. You can verify this by doing the same test with Safari. The safari app also won't rotate on the sim if launched on its side.
Issues are linked in commits and fix-version.
Update: For Blain's comment above: Safari in all three simulators (iPad, iPhone, iPhone retina) does not rotate after launch, this does not match actual device behavior, see below. Baseline Apple iOS behavior: On three devices (iPad 2 4.3.5, iPod 4.0.1, iPhone 4s 5.01) held in landscape: When launching safari on iPad, the UI is always landscape, and safari launches landscape. On the other two devices, the main screen ui is in portrait even while the device in landscape. Launching safari begins in portrait, then rotates to landscape on load. Investigation: Using an app with
Closing bug. Verified fix on: OS: Mac OS X Lion Titanium Studio, build: 1.0.7.201112061404 SDK build: 1.8.0.1.v20111207151125 Device: iphone 4S Sprint (5.0.1)