私はチタンを使用しており、iOSでカメラをテストしています。カメラページを通過する前にカメラページを実行した後のコードで問題が発生します。以下のコードでは'alert('Picture uploaded successfully.')
、カメラ画面が開く前に行が実行されます。何かアイデアはありますか?
var wincam;
wincam = Titanium.UI.createWindow();
if (Ti.Platform.osname === 'android') {
win.addEventListener('open', function(e) {
});
} else {
Titanium.Media.showCamera({
success:function(event)
{
var cropRect = event.cropRect;
var image = event.media;
Ti.API.debug('Our type was: '+event.mediaType);
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)
{
var imageView = Ti.UI.createImageView({
width:win.width,
height:win.height,
image:event.media
});
win.add(imageView);
}
else
{
alert("got the wrong type back ="+event.mediaType);
}
},
saveToPhotoGallery:false,
allowEditing:true,
mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]
});
}
//open next page
var w3 = Titanium.UI.createWindow({
backgroundImage:'/images/5-survey.png'
});
w3.open();
alert('Picture uploaded successfully.');