我已經嘗試將MathML代碼放入WebView中,並且它不能正確呈現。我做錯了什麼?WebView和MathML
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class HelloWebView extends Activity {
WebView mWebView;
String mathml = "<html><body><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><msup> <mi>x</mi> <mn>2</mn> </msup></mrow></math> END OF TEST</body></html>";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadData(mathml, "text/html", "utf-8");
}
}
IPython在他們的Notebook中也使用Mathjax,它的工作原理非常好。 – 2013-03-07 22:19:00