下面的代碼導致不同的輸出不同的android和ios。下面的myBlob是ios上的{} - 即使在屏幕上繪製後圖像也是空的。在Android中它具有屬性的對象並且工作正常,但iOS圖像始終爲空。鈦ti.paint toimage()在繪製ios後返回{}
這是以前在過去的ios版本和構建,所以我不建設它的權利?我們正在爲鈦SDK使用5.3.0 GA。我已經在TiApp編輯器中爲iOS檢查了模塊。
function uploadImage(signed) {
if (signed) {
var myBlob;
try {
myBlob = $.viewPaint.toImage();
var myImage = Titanium.Utils.base64encode(myBlob).toString();
$.nextAction.image = myImage;
} catch (ex) {
Titanium.API.error('FAILURE HANDLING SIGNATURE DOCUMENT: ' + ex);
return;
}
}
$.nextAction.perform(Alloy.Globals.requests);
}
鈦塗料模塊爲iPhone
#
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.4.0
apiversion: 2
architectures: armv7 i386 x86_64 arm64
description: Provides a paint surface user interface view.
author: Jeff Haynie
license: Appcelerator Commercial License
copyright: Copyright (c) 2010-2014 by Appcelerator, Inc.
# these should not be edited
name: paint
moduleid: ti.paint
guid: 43f13063-d426-4e9c-8a7a-72dc5e4aec57
platform: iphone
minsdk: 3.4.1.GA
在前代碼,增加了執行行動對象
var route = action.action.uri;
Ti.API.info('route = ' + route);
newAction.execute = function(requestManager) {
Titanium.App.fireEvent('app:index:view:requested',
controller : 'signscreen',
uri : route
});
};
代碼觸發該事件打開:
Titanium.App.fireEvent('app:index:view:requested', {
controller : 'signature'
});
ahhhh,謝謝....那是一個createAlertDialog! – user6701009