【问题标题】:Conversion of MathML to something which I can put in TextView or WebView on receiving the MathML string inside HTML tags将 MathML 转换为我可以在接收 HTML 标记内的 MathML 字符串时放入 TextView 或 WebView 的内容
【发布时间】:2017-05-02 11:22:01
【问题描述】:

我从 Web 服务收到类似这样的字符串:

<p><span class="equation">(x = {-b pm sqrt{b^2-4ac} over 2a})</span><span class="equation">(x = {-b pm sqrt{b^2-4ac} over 2a})</span></p></br>

我想在 TextView 或 WebView 中显示。它包含我想以适当的形式转换的 MathML。

我在网上看到 MathML 可以转换为图像形式并使用。

【问题讨论】:

标签: android mathml


【解决方案1】:

您可以使用 Android.text.Spanned 在 textView 中呈现它

Spanned htmlAsSpanned = Html.fromHtml(yourString);
textView.setText(htmlAsSpanned);

希望对您有所帮助!

【讨论】:

    猜你喜欢
    • 2012-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多