[TIMOB-2458] iPad Orientation Bug on start
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-10-27T15:17:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2011-36, Release 1.8.0 |
Components | iOS |
Labels | ipad, module_orientation, orientation, qe-testadded |
Reporter | Adriano Paladini |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:20:18.000+0000 |
Updated | 2013-08-30T09:11:56.000+0000 |
Description
Hi, everbody
I have a serious problem in iPad orientation.
This error ocurred in 1.4.3 and 1.5.0 (11/29/2010).
My app has this code:
var win = Ti.UI.createWindow({
backgroundImage: 'img/bkg.png',
orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.LANDSCAPE_LEFT]
});
and in tiapp.xml:
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
<orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
My app start normal in Portrait, and rotate normal, but if i put iPad on Landscape before, and open my app, it show a landscape splash and switch to a portrait window in landscape mode.
Creating a window that is cut down and with black border the side.
Sorry for my poor english, i'm Brazilian.
Attachments
File | Date | Size |
---|---|---|
OrientationTest.zip | 2011-09-06T17:06:01.000+0000 | 1581804 |
photo 1.PNG | 2011-06-02T14:04:28.000+0000 | 25196 |
photo 2.PNG | 2011-06-02T14:04:28.000+0000 | 25179 |
Hi, i teste the final version of 1.5.0 and now this was corrected.
Going to mark this resolved, test submitted to internal tests.
Sorry to reopen, but this is still happening.
Changed tiapp.xml to:
The build/iphone/ directory was emptied before testing.
Tested on iPad Simulator with iPad-KS
Ti API 1.6 (Feb 4 2011 17:12 r349debe8)
Please refer to this HD ticket for details:
http://developer.appcelerator.com/helpdesk/view/71251#c336281">http://developer.appcelerator.com/helpdesk/view/71251#c336281
This is not a bug. Apple's documentation specifies that the first orientation listed in the Info.plist, when enforced, is the orientation that your app is forced into before starting. This is not something we can change.
IN ORDER TO GET AROUND THIS:
Ok. But how can I do it for a SplitView app ? Will it work on 1.5.1 ?
Also this does not change the fact that splitWindow is not obeying orientation... even when you set it explicitly, iPad keeps rotating the screen:
splitWin = Ti.UI.iPad.createSplitWindow({
});
Even with this piece of code on app.js and the proposed workaround, the window turns around with accelerometer...
Tested under 1.5.1 and continuous build 1.6.0-20110204141203-osx
As for Apple official iOS4 Documentation:
So the override is not being made I guess...
Reference: (https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/iPadControllers/iPadControllers.html#//apple_ref/doc/uid/TP40007457-CH6-SW1">https://developer.apple.com/library/ios/#featuredarticles/ViewContr...)
Nevermind, what you got to do is the following:
On tiapp.xml you need:
On your splitWindow declaration, you need:
And -on both- your views / windows (master and detail), you need:
Setting orientationModes on splitWindow, master and detail views / windows now forces the splitWindow based app to never rotate.
This should be documented...
Thanks.
Even with everything listed above set, if you start the application in Portrait mode (when only landscape is available), the first time it loads, you still get a split second rotation that shouldn't happen.
View here: http://screencast.com/t/71qQBMM7G">http://screencast.com/t/71qQBMM7G
Testing on device, built with 1.6RC1
Reference Ticket: http://developer.appcelerator.com/helpdesk/view/74261">http://developer.appcelerator.com/helpdesk/view/74261
This might be an apple bug, have to move it to TBS.
There is unclarity on this issue, so we will push to reevaluate this in next release's planning process.
Another repro case. If you set the orientation to Portrait only in tiapp.xml and then run the code below. When you start the app, hold the iPad up in landscape(it does not do it consistently if it is laying down). You will see that the navBar does not go to the top where it should. You will see the screen rotate (would rather not see this) and then the navBar will be set down from where it should be (see attached pictures).
Workaround
Add your elements to the window a short amount of time after the window opens.Tested With
TiSDK 1.7.0.RC1 iPad 1 3.2.2Associated Helpdesk Ticket
http://appc.me/c/APP-5212483.2 only - not seen on newer revs of OS - 1.7.2.v20110624152637
Confirmed to appear only on 3.2 devices. Pre-4.0 support is being dropped for release 1.8.0, and there is no reason to keep an iPad device at a version below 4.2.
Reopening.
tiapp.xml
app.js
To Reproduce:
Launch app in any orientation besides portrait.Expected behavior:
The app launches in it's current orientation mode.What really happens:
The app launches always in portrait. Environment:Resolved by https://github.com/appcelerator/titanium_mobile/pull/464.
Fix verified on iPad 4.3.5 and iPad 2 4.3.5. SDK used for testing: 1.8.0v20110915101349