我使用一個字符串作爲我的源方程,每當我嘗試添加像上劃線標記是:正確。越獄酒吧的逃生序列?
\ov5\ - creates a bar over the 5
然而,當我加入到這個Java字符串,它編譯我需要把它寫這樣的:
string x= "\\ov5\\";
這樣看來,這種方式打破JQMath並不起作用,導致破方程。這是在情況下,我做了非常錯誤的東西代碼:
WebView webView;
String functext = "$$\\ov55\\$$";
js = "<html><head>"
+ "<link rel='stylesheet' href='file:///android_asset/mathscribe/jqmath-0.4.3.css'>"
+ "<script src='file:///android_asset/mathscribe/jquery-1.4.3.min.js'></script>"
+ "<script src='file:///android_asset/mathscribe/jqmath-etc-0.4.3.min.js'></script>"
+ "</head><body>"
+ functext + "</body></html>";
webView.loadDataWithBaseURL("", js, "text/html", "UTF-8", "");
編輯:爲了澄清,最終的結果很奇怪寫着「$$ \ ov55 $$」。
請注意,當我在JQMath的網頁here上嘗試相同的字符串時,它會按預期工作。
EDIT2:下面是用於放置在webView.loadDataWithBaseURL斷點一些調試值:
實際串:字符串的FuncText = 「$$ \\\\ ov55 \\\\ $$」;
實際顯示的結果:$$ \ ov55 \ $$
debug results:
functext = $$\\ov55\\$$
js = <html><head><link rel='stylesheet' href='file:///android_asset/mathscribe/jqmath-0.4.3.css'><script src='file:///android_asset/mathscribe/jquery-1.4.3.min.js'></script><script src='file:///android_asset/mathscribe/jqmath-etc-0.4.3.min.js'></script></head><body>$$\\ov55\\$$</body></html>
與加載它在其他不是字符串,將有助於大大另闢蹊徑任何幫助。
非常不清楚。你期望的結果是什麼,你取得了什麼?順便說一句 - '\\ ov5 \\'不是'$$ ov \\ 55 \\ $$'。 – Seelenvirtuose
我的錯誤。我編輯澄清。不匹配只是一個錯字,問題仍然存在。 –