数学公式格式没有出现在android mathView中

问题描述 投票:0回答:1

我试图在我的Android应用程序中显示数学公式我使用tiny_mce与WIRIS插件编写公式为图像下面enter image description here

编辑器将公式存储在数据库中,格式如下

<p><math xmlns="http://www.w3.org/1998/Math/MathML"><mroot><mrow><mn>3</mn>
   <mi>x</mi></mrow><mn>2</mn></mroot><mo>&#215;</mo><mn>2</mn>
   <mimathvariant="normal">&#960;</mi></math></p>

我还在我的Android应用程序中使用MathView来显示以下公式

 MathView testMathView=(MathView) findViewById(R.id.test);
    testMathView.setText("<p><math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
          "<mroot><mrow><mn>3</mn><mi>x</mi></mrow><mn>2</mn></mroot>" +
          "<mo>&#215;</mo><mn>2</mn><mi mathvariant=\"normal\">&#960;</mi></math></p>");

但它不起作用它向我展示了没有数学公式符号的唯一数字

这里有一个GitHub库和MathView教程,它不适用于wiris编辑器MathView on github的输出

你有什么帮助或建议在Android应用程序中显示wiris输出格式吗?

java android android-studio tinymce-4 wiris
1个回答
2
投票

当我在GitHub的文档中阅读时,你应该在auto:engine="MathJax"MathView中设置setText,如下所示:

testMathView.setText("$$<p><math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
      "<mroot><mrow><mn>3</mn><mi>x</mi></mrow><mn>2</mn></mroot>" +
      "<mo>&#215;</mo><mn>2</mn><mi mathvariant=\"normal\">&#960;</mi></math></p>$$");

希望这会奏效。

© www.soinside.com 2019 - 2024. All rights reserved.