0

我有一个问题。我的程序在 iphone 的相册中拍照,但是当我点击本地照片按钮时,它直接打开Camera Roll而不是Albums。我的代码:

function startPhotoReplaceProcess(Context, ProfileType, PhotoId, Slot)
{
function getPhoto(source_type ) {

    function onPhotoURISuccess(uri) {

        Context.trigger("PhotoSelected", [true, ProfileType, PhotoId, Slot, uri]);
    }

    // Take picture using device camera, allow edit, and retrieve image
    //as base64-encoded string
    navigator.camera.getPicture(onPhotoURISuccess, onFail, {
        quality: 75,
        destinationType: navigator.camera.DestinationType.FILE_URI,
        //DATA_URL vs FILE_URI
        sourceType: source_type,
        allowEdit: true,
        encodingType: navigator.camera.EncodingType.JPEG,
        targetWidth: 100,
        targetHeight: 100,
        mediaType: navigator.camera.MediaType.PHOTO
    });
}

function onPhotoSourceDismissed(buttonId) {

     if (buttonId == 1) {
         getPhoto(navigator.camera.PictureSourceType.SAVEDPHOTOALBUM);
     }
     else if (buttonId == 2) {
         getPhoto(navigator.camera.PictureSourceType.CAMERA);
     }
 }

 navigator.notification.confirm(
   localization.confirms.photo_source.message,
   onPhotoSourceDismissed,
   localization.confirms.photo_source.title,
   localization.confirms.photo_source.album +","+localization.confirms.photo_source.camera+","+localization.confirms.photo_source.cancel
   );

}

有人可以帮我打开 iphone 的相册,但不能打开相机胶卷(Pellicule)吗?

4

1 回答 1

0

也许

sourceType: source_type --> sourceType: navigator.camera.PictureSourceType.SAVEDPHOTOALBUM

于 2013-02-01T05:52:42.220 回答