[TIMOB-4782] iPad Orientation Regression
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-09-14T16:07:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2011-36, Release 1.8.0 |
Components | iOS |
Labels | module_orientation, qe-testadded |
Reporter | Alan Leard |
Assignee | Blain Hamon |
Created | 2011-07-26T09:27:56.000+0000 |
Updated | 2014-06-19T12:46:21.000+0000 |
Description
If you set landscape only on an iPad app, 1.7.2 and up do not recognize it, and it launches in Portrait.
Test Code:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win.add(label1);
win.open()
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
The sample code is invalid; the window MUST provide its orientation preferences. The XML only specifies on launch. The reason that 1.7.1 and before had a different behavior was a bug where it was not updating its orientation requests properly. Below is a proper code snippet that, when put into the example app, does the correct behavior.
After adding the above code snippet, there is still a visual rotation on app launch that is not the desired result. Application should launch and statically display a landscape view, not the window rotating upon opening.
Associated HD ticket
Customer reported an issue alike this, http://appc.me/c/APP-537473Problem
if landscape_left and landscape_right are configured, the app always starts in landscape_right.Tested on
Simulator iOS 4.x / Device iPad 1Repro sequence
Additional info
Tried to manually set Orientation on Info.plist (copy&paste from Buld/iphone/Info.plist to Root project folder): {noformat}Tested On: Mac OSX Lion TiMob: 1.8.0v20110819142548 TiStud: 1.0.4.201108101535 Devices: iPhpne Simulator iPad2 version 4.3.5 iPhen4 version 4.2.10 iPod 3
Reopening issue. It is my understanding that if a window does not specify orientation, then it will get it's orientation from what is in the tiapp.xml. If so, then the original test code is valid and the issue is still occurring (tested in SDK 1.8.0v20110906155354).
Removed Sprint 2011-31 since it was re-opened.
resolved by https://github.com/appcelerator/titanium_mobile/pull/464
Fix verified on an iPad 2 4.3.5, iPad 4.3.5, iPhone 4 4.2.10, iPod 3rd gen 4.0.2. SDK used: 1.8.0v20110915133349 By design, the test case does need Blain's changes to be a proper test case.