I am getting error while opening photogallery.
Hello,
I have added webview.html in current window and on clicking on button of webview.html I call fireevent and in app.js I have write code like this but photo gallery not opening in my app.
code:
var w = Titanium.UI.createWindow({
title:'Modal Window',
url:'photo_gallery.js'
});
w.open({animated:true});
photo_gallery.js :
Titanium.Media.openPhotoGallery({
success:function(event)
{
var cropRect = event.cropRect;
var image = event.media;
var thumbnail = event.thumbnail;
// set image view
imageView.image = image;
Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);
},
cancel:function()
{
},
error:function(error)
{
alert(error);
},
allowImageEditing:true
});
2 Answers
-
same problem, any answers?
-
Me too, not working.
Here's my code (in the view that tries to open up..):
var win = Titanium.UI.currentWindow;
var popoverView;
var arrowDirection;Titanium.Media.openPhotoGallery({
success:function(event) { var cropRect = event.cropRect; var image = event.media; // set image view Ti.API.debug('Our type was: '+event.mediaType); Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width); }, cancel:function() { }, error:function(error) { }, mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
});
Actually works on emulator, yet crashes on actual iPhone 4.
-kristian