我已经TextView
使用以下代码完成了显示数学公式的代码。
webView.loadDataWithBaseURL("http://bar/", "<script type='text/x-mathjax-config'>"
+"MathJax.Hub.Config({ "
+"showMathMenu: false, "
+"jax: ['input/TeX','output/HTML-CSS'], " // output/SVG
+"extensions: ['tex2jax.js','toMathML.js'], "
+"TeX: { extensions: ['AMSmath.js','AMSsymbols.js',"
+"'noErrors.js','noUndefined.js'] }, "
+"'SVG' : { blacker: 30, "
+"styles: { path: { 'shape-rendering': 'crispEdges' } } } "
+"});</script>"
+"<script type='text/javascript' "
+"src='file:///android_asset/MathJax/MathJax.js'"
+"></script>"
+"<script type='text/javascript'>getLiteralMML = function() {"
+"math=MathJax.Hub.getAllJax('math')[0];"
// below, toMathML() rerurns literal MathML string
+"mml=math.root.toMathML(''); return mml;"
+"}; getEscapedMML = function() {"
+"math=MathJax.Hub.getAllJax('math')[0];"
// below, toMathMLquote() applies &-escaping to MathML string input
+"mml=math.root.toMathMLquote(getLiteralMML()); return mml;}"
+"</script>"
//+"<style type=\"text/css\">"
//+"@font-face { font-family: MyCustomFont;"
//+"src:url(\"file:///android_asset/shruti.ttf\");}"
//+"body {font-family: 'MyCustomFont';}"
//+"</style>"
+"<p><span id='math'></span><p><pre><span id='mmlout'></span></pre>"
+"<script type='text/javascript'>"
+"document.getElementById(\"math\").innerHTML='\\\\["+doubleEscapeTeX(question.getQuestion())+"\\\\]';"
+"</script>","text/html","utf-8","");
现在我想显示那种类型的内容,比如数学公式或 HTML 内容RadioButton
如何像 Radio 一样为该显示创建自定义RadioButton
视图。WebView
对你的帮助表示感谢。