[TIMOB-12029] iPad - OpenPhotoGallery does not work when Orientation mode is Landscape.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-02-11T21:17:44.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | Release 3.2.0 |
Components | iOS |
Labels | qe-closed-3.2.2, supportTeam |
Reporter | Amuktha Akkinepally |
Assignee | Ingo Muschenetz |
Created | 2012-12-11T21:49:42.000+0000 |
Updated | 2014-03-10T11:06:19.000+0000 |
Description
The Ti.Media.openPhotoGallery() does not work on iPad only when the app is set to landscape-only orientation on tiapp.xml, It works fine in portrait mode.
Steps to reproduce:
1. Load the below app.js and make the given changes in tiapp.xml.
2. Install the app on a device and click on here button
Expected result: It should open up the gallery
Actual Result: It does not open up the gallery
app.js
var btn = Ti.UI.createButton({
title:'here'
});
var win = Ti.UI.createWindow({
backgroundColor: '#ccc',
rightNavButton: btn,
orientationModes: [Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT]
});
btn.addEventListener('click', function(){
Ti.Media.openPhotoGallery({
popoverView: this
});
});
win.open({
modal: true
});
tiapp.xml
<orientations device="ipad">
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
This appears to be an iOS bug rather than Titanium. The UIImagePickerController allows for all four orientations, and apparently it relies somehow on the top most view controller's orientation. I created a "hello world" native app and when locked in one orientation the app crashed while trying to present the popover with the image gallery. After reading a bit about this on [StackOverflow](http://stackoverflow.com/questions/12540597/supported-orientations-has-no-common-orientation-with-the-application-and-shoul), I added these likes of code to the MediaModule.m to extend it and it started to work as expected.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0
Closing since the issue is not reproducible anymore since TISDK 3.2 or higher.
Tested with both the codes provided in the Description and comments.Issue is not reproducible using below environment: Environment: Appc Studio: 3.2.2.201402280732 Sdk: 3.2.2.v20140221161255 acs: 1.0.14 npm: 1.3.2 alloy:1.3.1 titanium:3.2.1 titanium-code-processor:1.1.0 Xcode: 5.1-beta5 Osx: Maverick(10.9.2) Device: iPad 3 (iOS 7.1) and iPhone 5S(iOS 7.1) OpenPhotoGallery is working fine with Landscape orientation mode.Hence closing the issue.