新しいアプリを開発中です。チタニウム 1.0 を使用して、フォトギャラリーを新しいウィンドウで開いていますが、開くことができません。なぜこれが起こったのですか?
app.js でフォトギャラリーを開くコード
Titanium.App.addEventListener('recordvideo', function(e) { win1.close();
var w = Titanium.UI.createWindow({
backgroundColor:'#336699', title:'モーダル ウィンドウ', barColor:'black', url:'xhr_testfileupload.js' });
w.open({animated:true});
});
xhr_testfileupload.js コード:
var win = Titanium.UI.currentWindow;
var ind=Titanium.UI.createProgressBar({ width:200, height:50, min:0, max:1, value:0, style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN, top:10, message:'アップロード中Image', font:{fontSize:12, fontWeight:'bold'}, color:'#888' });
win.add(ind); ind.show();
Titanium.Media.openPhotoGallery({
success:function(event) { Ti.API.info("success! event: " + JSON.stringify(event)); var image = event.media;
var xhr = Titanium.Network.createHTTPClient();
xhr.onerror = function(e) { Ti.API.info('IN ERROR' + e.error); }; xhr.onload = function() { Ti.API.info('IN ONLOAD' + this.status + 'readyState' + this.readyState); }; xhr.onsendstream = function(e) { ind.value = e.progress ; Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress); } // クライアントを開く xhr.open('POST',' https://twitpic.com/api/uploadAndPost ');
// データを送信します xhr.send({media:image,username:'fgsandford1000',password:'sanford1000',message:'check me out'});
}, キャンセル:関数() {
}, error:function(error) { }, allowImageEditing:true, });