0
当打开图片库时有时应用程序崩溃,有时它不会。 它显示了一个java异常,但没有有意义的消息。Appcelerator - Android open image galley
有没有人有想法?我也使用意图,但不能得到它的工作。
Thnxs!
这里我的代码示例:
Here a sample of my code:
function openGallery() {
var popoverView;
var arrowDirection;
if(Titanium.Platform.osname == 'ipad') {
// photogallery displays in a popover on the ipad and we
// want to make it relative to our image with a left arrow
arrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT;
popoverView = imageView;
}
var image = undefined;
Titanium.Media.openPhotoGallery({
success : function(event) {
var cropRect = event.cropRect;
image = event.media;
// set image view
Ti.API.debug('Our type was: ' + event.mediaType);
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
addAttachment(image);
} else {
// is this necessary?
}
},
cancel : function() {
},
error : function(error) {
},
allowEditing : true,
saveToPhotoGallery : true,
popoverView : popoverView,
arrowDirection : arrowDirection,
mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO]
});
}
请显示一些代码。 –
对不起刚刚发布它 – Jefiozie