2010-04-06 85 views
1

我正在開發新的應用程序。使用鈦1.0在這我打開phtogallery在新窗口,但我無法打開爲什麼發生這種情況?圖片庫不在鈦打開1.0

代碼以在app.js打開照相館

Titanium.App.addEventListener( 'recordvideo',函數(E) { win1.close();

var w = Titanium.UI.createWindow({ 

的backgroundColor:'# '''', url:'xhr_testfileupload.js' });

w.open({animated:true}); 

});

xhr_testfileupload.js代碼:

變種贏= Titanium.UI.currentWindow;

變種IND = Titanium.UI.createProgressBar({ 寬度:200,高度 :50, 分鐘:0, 最大:1, 值:0, 樣式:Titanium.UI.iPhone.ProgressBarStyle。 PLAIN, top:10, message:'上傳圖片', font:{fontSize:12,fontWeight:'bold'}, color:'#888' });

win.add(ind); ind.show();

Titanium.Media.openPhotoGallery({

成功:功能(事件) { Ti.API.info( 「成功事件:」 + JSON.stringify(事件)); VAR圖像=事件.media;

變種XHR = Titanium.Network.createHTTPClient();

xhr.onerror =函數(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'});

}, 取消:功能() {

}, 錯誤:功能(錯誤) { }, allowImageEditing:真, });

回答

0

我也面臨這個問題。相同的代碼在0.8.x下運行良好。我已經在Appcelerator的Q &上創建了一個request,因爲他們的團隊可能不會經常在這裏檢查。