この問題を理解するのに丸一日かかりました。私はウェブアプリに取り組んでいます(Phonegap + HTML + jQuery + CSSを使用)。これは、ユーザーの署名を表示する1つの画面で構成されています。iPhoneで使用しているのと同じ.jsファイルを使用しましたが、署名画像は問題なく表示されていますが、Androidでは同じコードが機能していません(Android 2.2.1、2.3.3、3.0、4.0を使用してみました)しかし、何も機能しません。以下は私の.jsファイルからのコードスニペットです:
SignatureButtonThumbComponent.prototype.setInitialValue = function () {
var date, value;
value = this.record.valueForField(this.config.key);
//value = window.btoa(this.record.valueForField(this.config.key)); // Not Working
console.log("Signature Value : " + value);
console.log("Signature Date value : " + date);
date = this.record.valueForField(this.config.key_date);
if (value !== 'undefined') {
this.el.append("<button class='captured_signature_button'><img src='" + value + "'/></button>");
if (date) {
return this.el.append("<div class='signature_date'>" + (Formatter.timeFormattedNicely(date)) + "</div>");
}
} else {
return this.el.append("<button class='big blue arrow_button' id='get_patient_signature'><span>" + this.config.button_label + "</span><span class='icons arrow_right'></span></button>");
}
};
編集:以下は私のlogcat出力です:
09-21 12:01:19.562: D/PhoneGapLog(1362): Signature Date value : undefined
09-21 12:01:19.672: D/PhoneGapLog(1362): Signature Value : undefined
もう少し考えた後、logcatで取得しているのはこれです:
09-21 16:33:27.947: D/PhoneGapLog(948): file:///android_asset/www/new_mobile.js: Line 15790 : Signature Value : data:,